This question comes up fairly often, particularly in the cloud deployment world where we deploy instances of Neo4j with HTTPS open by default, and folks need valid certificates.
If you haven't used Let's Encrypt before, it's a free way of getting valid certificates for a host name you control. I wrote up the process of how to use Let's Encrypt with Neo4j, and how to install those certificates into your Neo4j instance.
Hope it's helpful!
Thanks for submitting!
I’ve added a tag that allows your blog to be displayed on the community home page!
This is more than helpful ! Certificates are the bane of even experienced system administrators and this document hands you the tools to do the job. Great stuff !
Hi David, Your article on using LetsEncrypt with Neo4j was fantastic. I have been trying to implement ssl on my neo4j backed website for a while now and this pulled it all together.
I'm not sure if this is the correct forum to post issues like this so feel free to direct me elsewhere if required.
I can access my website using https after installing the LetsEncrypt files as outlined in your article. However when I try to access the neo4j browser via https://www.mysite.com:7473 it will not connect. I can access using standard http. I have checked the port is open on my firewall and I have gone through all the steps and checks as outlined. I suspect I may have something small incorrect in my neo4j.conf file as I have tried many options to get it working. I'm using a ubuntu 16.04 based server.
Would it be possible to take a look below and provide any suggestions? I would be eternally grateful!
Ah, I just got finished writing you a response on Medium and now I see you've already posted here.
dbms.connector.https.listen_address=:7473 is a bit inconsistent, it shouldn't matter but you're missing the 0.0.0.0 which binds to all network devices.
Everything else at first glance looks OK, which is why in the medium post I was requesting that you follow up with some specifics on what your browser is reporting.
Also, I take it as given that the certs you've installed are for www.mysite.com (not some other domain) and that www.mysite.com resolves to your machine? Is this cluster or standalone server?
Again thanks for your prompt response. The browser is just showing time out error ERR_CONNECTION_TIMED_OUT and no errors are showing in the console. The machine is a standalone server. I generated the scripts using the full URL and just used www.mysite.com for example. If i use http://www..com:7474 it opens the neo4j browser fine however using https://www..com:7473 fails to load and times out.
Any ideas on what else I could check would be greatly appreciated. I'm at my wits end!
Again many thanks for your help on this topic. The browser is just showing a timed out error ERR_CONNECTION_TIMED_OUT and no error messages are appearing the Console. I have generated the certs using my own URL and only used www..com for demo purposes. The machine is a standalone server.
Using http://www..com:7474 accesses the neo4j browser fine, however https://www..com:7473 times out as mentioned.
Any ideas on what else I could check would be greatly appreciated!
I can't prove it, because it depends on the details of how you've deployed, but 99 times out of 100, connection timed out errors mean one of two things:
dbms.connector.https.enabled=false, and so you're not running https, and so neo4j isn't listening at all on that port.
- Your local firewall rules don't permit traffic to port 7473.
The second explanation is the more likely one. By default, all clouds firewall all ports out. When you send traffic on those ports, the firewall at the cloud provider just drop your packets on the floor, and connection timeouts are how that manifests.
Apologies regarding double post.
I checked that port 7473 was open and it returned:
tcp6 0 0 :::7473 :::* LISTEN
I then tried two commands:
sudo ufw allow https
sudo ufw allow 443
Which seems to have added further rules to my firewall.
However the good news is that it now works!
Thanks again for your time and help in pointing me in the right direction.
I am facing an issue Failed to start Neo4j on 0.0.0.0:7474: HTTPS set to enabled, but no SSL policy provided
Running Neo4J 4.0.4 and its in docker
below is my configuration
Thank you so much; however, when I tried to set up the SSL in your method, the neo4j restart with an error "not sudoer"
I solve this issue by rewrite the public.crt and private.key explained in the following way, hope you found it helpful.
Getting Valid SSL Certificates for Neo4j with Let’s Encrypt