Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BOLT TLS #8

Open
tim-hanssen opened this issue Nov 10, 2020 · 3 comments
Open

BOLT TLS #8

tim-hanssen opened this issue Nov 10, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@tim-hanssen
Copy link

Hi all,

I'm trying to setup a BOLT connection to a Neo4j 4.1.4 server using BOLT TLS encrytion on REQUIRED.

        $config = \PTS\Bolt\Configuration::newInstance()
            ->withCredentials(config('neo4j.master.username'), config('neo4j.master.password'))
            ->withTLSMode(\PTS\Bolt\Configuration::TLSMODE_REQUIRED);

        $listener = new EventListener();

        $this->clientWriter = Neo4jClientBuilder::create()
            ->addConnection('default', 'bolt://'.config('neo4j.master.username').':'.config('neo4j.master.password').'@'.config('neo4j.master.host').':'.config('neo4j.master.port'), $config)
            ->setDefaultTimeout(10)
            ->setMaster('default')
            ->registerEventListener(Neo4jClientEvents::NEO4J_PRE_RUN, [$listener, 'onPreRunWrite'])
            ->build();

        return $this->clientWriter;

The neo4j logs are reporting a unencrypted connection. Any suggestions?

@matas-valuzis
Copy link

Looks like TLS mode not working even on older versions of Neo4j. Not sure if it ever worked but I'll investigate some more. If you know how to fix it, feel free to submit a PR with some tests.

@matas-valuzis matas-valuzis added the bug Something isn't working label Nov 11, 2020
@tim-hanssen
Copy link
Author

Hey @matas-valuzis I would think we somehow also should need to include a certificate. I'm going to try to test some things too.

@matas-valuzis
Copy link

@tim-hanssen Did you manage to set up a testing environment? I'm having issues launching Neo4j with tls mode. I have created a self signed certificate and set dbms.ssl.policy.bolt.enabled=true and it looks like Neo4j is reading the certificate file because it fails to start if it can't read the file due to permissions. I'm testing ssl connection with openssl command: openssl s_client -connect localhost:7687 and it looks like Neo4j is still operating in non tls mode. Do you have a working set up? (preferably docker)

@matas-valuzis matas-valuzis mentioned this issue Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants