And NGINX is setup to proxy the Bolt socket with TLS on :7687 for 127.0.0.1:7687 via:
stream {
upstream boltdb {
server 127.0.0.1:7687;
}
server {
listen 7687 ssl so_keepalive=on ;
proxy_pass boltdb;
proxy_connect_timeout 3s;
proxy_timeout 5s;
# Sets up SSL and certs
include streams.d/includes/mydomain-tls-enable.inc;
}
}
The end result is a secure Neo4j Browser UI at https://neo4j.mydomain.com that can be browsed without any console errors.
Logging into neo4j+s://neo4j.mydomain.com:7687 or bolt+s://neo4j.codelica.com:7687 is also successful. However it also results in endless JS console warnings:
Neo4j driver is configured to use secure WebSocket on a HTTP web page. WebSockets might not work in a mixed content environment. Please consider configuring driver to not use encryption.
The web page being served by the proxy is most definitely HTTPS and is actually proxying an HTTPS Neo4j Browser service. (Originally I tried to proxy the 7474 HTTP Browser service and thought that might be the issue so I moved to HTTPS internally also -- result was the same). That warning seems to be the result of client side protocol checks, but for the life of me I can't see how it doesn't see the page is HTTPS. Relevant code for the warning is here:
Which is of course true when testing in the broswer console itself. So I'm at a loss. Maybe this is better under the neo4j-javascript-driver repo, but it seems like something else must be at play here? Please feel free to humiliate me if I'm missing something basic or there are some docs to set me straight. I'm new to Neo4j, but have exhausted a lot of searches trying to get the proxy setup to be clean.
Expected behavior
Connect with HTTPS and WSS cleanly, no console warnings.
Actual behavior
Endless console warnings:
Neo4j driver is configured to use secure WebSocket on a HTTP web page. WebSockets might not work in a mixed content environment. Please consider configuring driver to not use encryption.
Steps to reproduce
I'm looking to provide a secure proxy (via NGINX) to the Neo4j browser. Neo4j is running configured as follows:
http service disabled. https service exposed as 127.0.0.1:7473 using a looooong expiration self-signed cert. bolt service exposed as 127.0.0.1:7687
Via the following Docker Compose:
Then NGINX is setup to proxy the Web UI via:443 for 127.0.0.1:7473 via:
And NGINX is setup to proxy the Bolt socket with TLS on:7687 for 127.0.0.1:7687 via:
The end result is a secure Neo4j Browser UI at https://neo4j.mydomain.com that can be browsed without any console errors.
Logging into neo4j+s://neo4j.mydomain.com:7687 or bolt+s://neo4j.codelica.com:7687 is also successful. However it also results in endless JS console warnings:
Neo4j driver is configured to use secure WebSocket on a HTTP web page. WebSockets might not work in a mixed content environment. Please consider configuring driver to not use encryption.
The web page being served by the proxy is most definitely HTTPS and is actually proxying an HTTPS Neo4j Browser service. (Originally I tried to proxy the 7474 HTTP Browser service and thought that might be the issue so I moved to HTTPS internally also -- result was the same). That warning seems to be the result of client side protocol checks, but for the life of me I can't see how it doesn't see the page is HTTPS. Relevant code for the warning is here:
https://github.com/neo4j/neo4j-javascript-driver/blob/22c4c59947c17b825d81be3d19bedebf703b76d4/src/internal/browser/browser-channel.js#L329
secureProtocol
is abstracted but seems to boil down to roughly:window.location.protocol && window.location.protocol.toLowerCase().indexOf('https') >= 0
Which is of course
true
when testing in the broswer console itself. So I'm at a loss. Maybe this is better under the neo4j-javascript-driver repo, but it seems like something else must be at play here? Please feel free to humiliate me if I'm missing something basic or there are some docs to set me straight. I'm new to Neo4j, but have exhausted a lot of searches trying to get the proxy setup to be clean.Expected behavior
Connect with HTTPS and WSS cleanly, no console warnings.
Actual behavior
Endless console warnings:
Neo4j driver is configured to use secure WebSocket on a HTTP web page. WebSockets might not work in a mixed content environment. Please consider configuring driver to not use encryption.