WebSocket connection failure. Due to security constraints in your web browser
Asked Answered
W

11

8

Today I download neo4j-community-3.2.0 in windows, when i start the server, i meet one problem in browser, i meet this problem in neo4j-community-3.1.2 and i had solved it by Ticking the "Do not use Bolt" option in settings solved the issue. But in neo4j-community-3.2.0 , i can't see "Do not use Bolt" option ,and i don't know how to do.

N/A: 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

Wrinkle answered 7/6, 2017 at 7:25 Comment(5)
Possible duplicate of Neo4J 3.1.3 graph database access remotelyHerron
i solve this problem, because bolt. change bolt config in neo4j.conf this problem will solve.Wrinkle
Thanks for posting your answer in comments, Please Write it as answer, & Accept it.Herron
1. In the lower left corner of the browser gear, select do not use bolt 2. In ${NEO4J_HOME}/conf/neo4j.conf, edit the bolt settings 3. Change the version of Neo4jWrinkle
why dont you write your answer, instead of in Comments ??Herron
W
1
  1. In the lower left corner of the browser gear, select do not use bolt.
  2. Open your ${NEO4J_HOME}/conf/neo4j.conf file and edit the bolt settings. It is just about uncommenting this line dbms.connector.bolt.address=0.0.0.0:7687
  3. Change the version of Neo4j
  4. Check your JDK version, use JDK1.8
Wrinkle answered 9/11, 2017 at 4:10 Comment(0)
P
9

This happens because the browser is trying (under the hood) to also access the bolt port, which uses an unsigned certificate.

You probably allowed the browser to access the SSL 7474 port through allowing the unsigned certificate as an exception on your browser (and if you didn't, you should in order to make it work). The url was:
https://[neo4j_host]:7474

Do the same for the bolt certificate, allow it as an exception for url:
https://[neo4j_host]:7687

Pileum answered 14/8, 2018 at 22:5 Comment(2)
Thank you! This has been plaguing me for a year on Firefox and this finally solved my issue. This knowledge base article really needs to be updated: neo4j.com/developer/kb/…Sympathin
https://[neo4j_host]:7687, Run this in browser and proceed by adding to exception list will work. Thank you @PeterBesiege
A
4

I ran into the same problem trying to use Neo4j Community Edition on an AWS Ubuntu 16.04 instance. The key thing that solved it was to open port 7687 (the bolt port) in the AWS security group settings.

Found this based on https://mcmap.net/q/1323725/-neo4j-n-a-websocket-connection-failure

Thus, full answer is:

  1. Make sure to configure Neo4j correctly, ie. uncomment the line dbms.connectors.default_listen_address=0.0.0.0 AND the line dbms.connector.bolt.listen_address=:7687
  2. Open ports 7474 AND 7687 in the AWS security group settings.
Aldos answered 6/4, 2018 at 10:31 Comment(0)
P
2

Adding another option, which worked for me. If your bolt's tls_level is set to REQUIRED, you need to change it to OPTIONAL, if you are not using it with SSL certificate; to get this working.

If you are using Neo4J Community Edition (ver 3.5.1 - in my case) from AWS Marketplace, you need to change the configuration in:

/etc/neo4j/pre-neo4j.sh

Change this line:

echo "dbms_connector_bolt_tls_level" "${dbms_connector_bolt_tls_level:=REQUIRED}"

to

echo "dbms_connector_bolt_tls_level" "${dbms_connector_bolt_tls_level:=OPTIONAL}"

You can find more about Neo4J connector configuration option here. Ideally as per docs, by default bolt.tls_level should have been OPTIONAL only. But I'm not really sure what exactly happened in my case, which got it changed to REQUIRED. Or if it came as is from AWS Marketplace.

Practically answered 20/2, 2019 at 7:8 Comment(0)
W
1
  1. In the lower left corner of the browser gear, select do not use bolt.
  2. Open your ${NEO4J_HOME}/conf/neo4j.conf file and edit the bolt settings. It is just about uncommenting this line dbms.connector.bolt.address=0.0.0.0:7687
  3. Change the version of Neo4j
  4. Check your JDK version, use JDK1.8
Wrinkle answered 9/11, 2017 at 4:10 Comment(0)
L
1

Assuming you have valid certs and placed them under the correct certificates directory:

dbms.ssl.policy.bolt.client_auth=NONE

Version 4.0. Took it from this article.

I shared my full ssl config on this other answer.

Loggia answered 27/1, 2020 at 6:30 Comment(0)
K
1

Please mention the correct bolt port under the Connect URL textbox.if you are using the service port the mention the service port in place of bolt port. enter image description here

enter image description here

Then finally I resolve it by replacing the bolt port with service port inside k8s. user: neo4j password: neo4j

Kibitzer answered 29/4, 2021 at 18:44 Comment(0)
T
0

I had the same error. New to Neo, so take this with a grain of salt, but my solution didn't match these above idea. But thanks as they did lead me to the right "water". So

I went into the conf file, noticed that there was the same port number (previously, the Neo desktop had been constantly telling me it'd needed to update the port numbers...I never checked to verity, but they'd be #, #+1 and #+2. But that didn't work yet that'd happened again and again...but now, after checking the conf file myself, I noticed that the number was the same for all three port requirements for BOLT. Tried that and it didn't work either...but maybe that was important in what did:

In the folder, where the specific database is housed, named "..neo4jdatabases/[GUID Value]" there were two directories titled "/installation-3.4.0" and "...1". I removed the ".0", restarted things and IT WORKED.

So, either there should NOT be two versions under the same database collection OR that's true AND you need the three ports to be the same.

Final add for any Neo4j experts who actually know what they're doing, I have three databases running, two without issue. This occurred AFTER I was messing around trying to see how PowerShell might be useful. Not sure if this is related, but the other databases have worked fine...but, this db is the original playground/sandbox I'd had since the beginning. Not 100% sure, I made the version update before or after, creating the other two databases. HTH.

Using a windows trial version on a Windows 10 machine. Current N4j version is 3.4.1.

Do love what I see so far with Neo BTW!!!

Tucky answered 16/7, 2018 at 17:36 Comment(0)
K
0

I resolve this error by replace the port 7687 with node port 30033 inside Neo4j then it works fine.

Kibitzer answered 18/5, 2021 at 19:5 Comment(0)
S
0

I was facing the same issue with Neo4J version 4 installed on an Ubuntu 18 EC2 instance. Tthe workaround that did the trick for me was to replace the 0.0.0.0 entries in /etc/neo4j/neo4j.conf with the actual private IP of my instance.

Following are the lines where the replace happened:

dbms.default_listen_address=172.X.X.232

dbms.connector.bolt.address=172.X.X.232:7687

Post restart of the DB, the Connect URL when accessing from browser should also use the private IP instead of localhost.

Sunbow answered 14/7, 2021 at 18:57 Comment(0)
H
0

for me it was uncommenting the following rule in the .conf file

server.bolt.listen_address=:7687

I was not able to locate the dbms.connector.bolt.address=0.0.0.0:7687

Hammer answered 5/6, 2024 at 8:42 Comment(0)
U
0

I closed the powershell.exe which is running in the background and ran into the same error. Fixed by simply restarting

Unto answered 26/6, 2024 at 23:12 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.