Skip to content

Commit de58703

Browse files
committed
Merge branch '1.0' into 1.1
# Conflicts: # lib/browser/neo4j-web.min.js # lib/browser/neo4j-web.test.js # src/v1/internal/ch-node.js # test/v1/tck/steps/tlssteps.js
2 parents 16ad801 + dcc7184 commit de58703

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/v1/internal/ch-node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ const TrustStrategy = {
117117
}
118118

119119
let tlsOpts = {
120-
ca: opts.trustedCertificates.map(fs.readFileSync),
120+
ca: opts.trustedCertificates.map((f) => fs.readFileSync(f)),
121121
// Because we manually check for this in the connect callback, to give
122122
// a more helpful error to the user
123123
rejectUnauthorized: false
@@ -131,7 +131,7 @@ const TrustStrategy = {
131131
" is a security measure to protect against man-in-the-middle attacks. If you are just trying " +
132132
" Neo4j out and are not concerned about encryption, simply disable it using `encrypted=\"" + ENCRYPTION_OFF +
133133
"\"` in the driver" +
134-
" options."));
134+
" options. Socket responded with: " + socket.authorizationError));
135135
} else {
136136
onSuccess();
137137
}

test/internal/tls.test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,24 @@ describe('trust-signed-certificates', function() {
6666
driver.session().run( "RETURN 1").then( done );
6767
});
6868

69+
it('should handle multiple certificates', function(done) {
70+
// Assuming we only run this test on NodeJS with TOFU support
71+
if( !NodeChannel.available ) {
72+
done();
73+
return;
74+
}
75+
76+
// Given
77+
driver = neo4j.driver("bolt://localhost", neo4j.auth.basic("neo4j", "neo4j"), {
78+
encrypted: true,
79+
trust: "TRUST_SIGNED_CERTIFICATES",
80+
trustedCertificates: ["build/neo4j/certificates/neo4j.cert", "test/resources/random.certificate"]
81+
});
82+
83+
// When
84+
driver.session().run( "RETURN 1").then( done );
85+
});
86+
6987
afterEach(function(){
7088
if( driver ) {
7189
driver.close();

0 commit comments

Comments
 (0)