How to use custom self signed certificates in Neo4j (instead of snakeoil.cert)?

ε祈祈猫儿з 提交于 2019-12-06 14:05:25

sudo vi /etc/neo4j/neo4j-server.properties

uncomment org.neo4j.server.webserver.address=0.0.0.0
check: org.neo4j.server.webserver.https.enabled=true
check: org.neo4j.server.webserver.https.port=7473
change: org.neo4j.server.webserver.https.cert.location=/var/ssl/neo4j/server.crt
change: org.neo4j.server.webserver.https.key.location=/var/ssl/neo4j/server.key

now set up access to https note: both the private key and the certificate need to be in DER format

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.pem
openssl genrsa -des3 -out server.key 4096
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -CA ca.pem -CAkey ca.key -set_serial 01 -out server.pem
sudo mkdir -p /var/ssl/neo4j
sudo openssl x509 -outform der -in server.pem -out /var/ssl/neo4j/server.crt
sudo openssl rsa -in server.key -inform PEM -out /var/ssl/neo4j/server.key -outform DER

See also [my notes] (http://www.blaeu.com/nl/doku.php/Notes)

As of 3.0 this has been changed.

  • Open up /etc/neo4j/neo4j.conf and uncomment and change the following line:

    # dbms.directories.certificates=/PATH/TO/YOUR/CERTIFICATES
    
  • Make sure that directory contains you certificate files named neo4j.key and neo4j.cert.

  • Make sure the files can be written by neo4j.

If you're using only .pem files, you can just rename those to .cert and .key, they're all plain text files, .pem is just an extension.

See the reference

Directory for storing certificates to be used by Neo4j for TLS connections.

Certificates are stored in the certificates directory, and are called neo4j.key and neo4j.cert.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!