Hi all,
We are using the NODEJS neo4j driver to connect to a neo4j community instance neo4j:4.1.2.
That instance is configured to use BOLT with SSL:
dbms.default_listen_address=0.0.0.0
# BOLT Connector
dbms.connector.bolt.tls_level=REQUIRED
dbms.ssl.policy.bolt.enabled=true
dbms.ssl.policy.bolt.private_key=/var/lib/neo4j/certificates/bolt/private.key
dbms.ssl.policy.bolt.public_certificate=/var/lib/neo4j/certificates/bolt/public.crt
dbms.ssl.policy.bolt.client_auth=NONE
dbms.connector.bolt.listen_address=0.0.0.0:7687
# HTTPS connector
dbms.connector.http.enabled=false
dbms.connector.https.enabled=true
dbms.ssl.policy.https.enabled=true
dbms.ssl.policy.https.client_auth=NONE
dbms.ssl.policy.https.private_key=/var/lib/neo4j/certificates/https/private.key
dbms.ssl.policy.https.public_certificate=/var/lib/neo4j/certificates/https/public.crt
dbms.connector.http.listen_address=0.0.0.0:7473
# Directories
dbms.ssl.policy.bolt.base_directory=/var/lib/neo4j/certificates/bolt
dbms.ssl.policy.https.base_directory=/var/lib/neo4j/certificates/https
When the Neo4j javascript driver is configured in this way:
driver = neo4j.driver(
`bolt://${NEO4J_HOST}:${NEO4J_BOLT_PORT}`,
neo4j.auth.basic(NEO4J_BOLT_USERNAME, NEO4J_BOLT_PASSWORD),
{
encrypted: 'ENCRYPTION_ON',
},
);
It works perfectly when NEO4J_HOST is equals to MY.DOMAIN.COM (for which the certificates where issued).
BUT when I want to connect to it using an internal domain INTERNAL.DOMAIN.COM I receive ERR_TLS_CERT_ALTNAME_INVALID even though I added the same "public.crt" to the trustedCertificates as shown below:
driver = neo4j.driver(
`bolt://${NEO4J_HOST}:${NEO4J_BOLT_PORT}`,
neo4j.auth.basic(NEO4J_BOLT_USERNAME, NEO4J_BOLT_PASSWORD),
{
encrypted: 'ENCRYPTION_ON',
trust: 'TRUST_CUSTOM_CA_SIGNED_CERTIFICATES',
trustedCertificates: [path.resolve(__dirname, './public_cert.pem')],
},
);
Any kind of help is more than welcome due to we use this in production,
Regards.