graphaware / neo4j-bolt-php

PHP Driver for Neo4j's Binary Protocol : Bolt
MIT License
42 stars 38 forks source link

Connection to GrapheneDB cloud db gives "Error receiving data" #26

Open sfdreverman opened 7 years ago

sfdreverman commented 7 years ago

As a test, I've recently created a graphenedb instance in the cloud.

I've filled in the remote connection strings in the config.yml and then I get an "Error receiving data", with no clue what is going wrong. The scheme, host and port are correct because if I change them, they give a different error. Which is good. The other values (username and pwd), are correct imo. (and with locally configured db, the app works fine.)

Changing the user or password (to incorrect values) results in the same error. (!)

  1. How can I pinpoint what part of the connection config causes the error?

Reading the graphenedb PHP guide, it appears to need a TLS required setting.

  1. How do I set this/check if this is set?
ikwattro commented 7 years ago

Does the README help ?

https://github.com/graphaware/neo4j-bolt-php#tls-encryption

sfdreverman commented 7 years ago

Actually, yes and no. It does because I found out about the TLS support. It also doesn't since I'm using the wrapper for symfony, which hides the ClienBuilder stuff. I just call a GetClient which creates/retrieves the connection. I've posted this on https://github.com/neo4j-contrib/neo4j-symfony and they told me to ask here... 😕

ikwattro commented 7 years ago

Allright, I will check that on the symfony wrapper side. Thanks.

cc @Nyholm

sfdreverman commented 6 years ago

Hi @ikwattro and @Nyholm ,curious: is there any progress on this issue? Thanks!

EtienneSchmitz commented 6 years ago

Hello @sfdreverman, I have the same problem that you. Have you found a solution ?

Otherwise, I found one thanks to the readme. There she is :

$config = \GraphAware\Bolt\Configuration::newInstance()
            ->withCredentials('username, 'password)
            ->withTLSMode(\GraphAware\Bolt\Configuration::TLSMODE_REQUIRED);
$driver = \GraphAware\Bolt\GraphDatabase::driver('adress', $config);
$session = $driver->session();
// After that you can do $session->run('your query') that usual.

It is not pratical and it does not use the Symfony bundle but it works.

sfdreverman commented 6 years ago

I had found a solution yes... but it was much less clean than yours. I looked up the $config definition in the graphaware bundle and changed it to TLSMODE_REQUIRED. Yours is much better, because now you can switch between cloud and local when developing locally or deploying for production. Thanks!

(btw I also spend 5 minutes trying to make it configurable through the GetClient call, but my php knowledge is way to shallow to do that. I'm just an architect developing some proof-of-concepts.