WebSocket connection failure : Neo4J





Problem:

Faced below error while connecting to Neo4J Community instance hosted in AWS EC2

ServiceUnavailable: WebSocket connection failure. Due to security constraints in your web browser, the reason for the failure is not available to this Neo4j Driver. Please use your browsers development console to determine the root cause of the failure. Common reasons include the database being unavailable, using the wrong connection URL or temporary network problems. If you have enabled encryption, ensure your browser is configured to trust the certificate Neo4j is configured to use. WebSocket `readyState` is: 3







Issue:

On hitting the URL for the first time "https://X.X.X.X:7473/browser/"
Browser complains about SSL certificates and I went ahead by adding the exception in case the browser is Firefox



Which presented the login box. But after filling details and hitting the button "Connect".  I was getting the above-mentioned error.


Reason:

Because we are connecting to different port and protocol, it's giving again certificate error.


Solution:

Try hitting the URL with the port used for bolt protocol i.e. in a new tab hit the URL "https://X.16.36.117:7687/"

You will be again presented with the same SSL certificate error.
Go ahead and add the exception.

After which I saw below message:

"not a WebSocket handshake request: missing upgrade"

For sure as this port is not listening to http requests.

Now try again connecting through the login box.
This time I got authenticated successfully.

HIH