I followed the instructions here to deploy a Neo4j instance on Amazon EC2.
At first I was unable to connect to the instance with cypher-shell -- the terminal returned the following error:
Unable to connect to localhost:7687, ensure the database is running and that there is a working network connection to it.
I was able to connect to the instance with the cypher-shell and browser by adding the following lines in the neo4j.template:
dbms.connector.bolt.listen_address=0.0.0.0:7687
dbms.connector.http.listen_address=0.0.0.0:8080
However, when I tried to enable the HTTPS connector using Cloudflare's Free SSL, all ports stopped working and I was unable to connect to the instance with cypher-shell and got the error Unable to connect to localhost:7687, ensure the database is running and that there is a working network connection to it
. Here are the changes appended at the end of the neo4j.template:
dbms.connector.https.enabled=true
dbms.ssl.policy.https.enabled=true
dbms.ssl.policy.https.client_auth=NONE
dbms.ssl.policy.https.private_key=/var/lib/neo4j/certificates/https/example.co.key
dbms.ssl.policy.https.public_certificate=/var/lib/neo4j/certificates/https/example.co.pem
dbms.ssl.policy.https.base_directory=/var/lib/neo4j/certificates/https
dbms.connector.https.advertised_address=abc.example.co:443
dbms.connector.https.listen_address=0.0.0.0:443
Note #1: I've ensured neo4j is able to access the certificates:
$neo4j-home> ls certificates/https
-r-------- ... example.co.key
-rw-r--r-- ... example.co.pem
drwxr-xr-x ... revoked
drwxr-xr-x ... trusted
Note #2:
-
I've also enabled the appropriate inbound rules in the security group.
-
I've checked the logs with
journalctl -e -u neo4j
. Nothings seems to be amiss. -
I restarted the neo4j with
sudo systemctl restart neo4j
every time I made modified neo4j.template