Skip to content

Commit 5f630cb

Browse files
committed
Merge branch '1.0' into 1.1
Conflicts: test/internal/tls.test.js
2 parents 0d3e6a4 + 4555cb1 commit 5f630cb

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/v1/internal/ch-node.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const TrustStrategy = {
100100
};
101101

102102
let socket = tls.connect(opts.port, opts.host, tlsOpts, function () {
103-
var serverCert = socket.getPeerCertificate(raw=true);
103+
var serverCert = socket.getPeerCertificate(/*raw=*/true);
104104

105105
if( !serverCert.raw ) {
106106
// If `raw` is not available, we're on an old version of NodeJS, and

test/internal/tls.test.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
var NodeChannel = require('../../lib/v1/internal/ch-node.js');
2020
var neo4j = require("../../lib/v1");
2121
var fs = require("fs");
22+
var hasFeature = require("../../lib/v1/internal/features");
2223

2324
describe('trust-signed-certificates', function() {
2425

@@ -46,7 +47,7 @@ describe('trust-signed-certificates', function() {
4647
});
4748

4849
it('should accept known certificates', function(done) {
49-
// Assuming we only run this test on NodeJS
50+
// Assuming we only run this test on NodeJS with TOFU support
5051
if( !NodeChannel.available ) {
5152
done();
5253
return;
@@ -56,7 +57,7 @@ describe('trust-signed-certificates', function() {
5657
driver = neo4j.driver("bolt://localhost", neo4j.auth.basic("neo4j", "neo4j"), {
5758
encrypted: true,
5859
trust: "TRUST_SIGNED_CERTIFICATES",
59-
trustedCertificates: ["build/neo4j-enterprise-3.1.0/conf/ssl/snakeoil.cert"]
60+
trustedCertificates: ["build/neo4j-enterprise-3.1.0/certificates/snakeoil.cert"]
6061
});
6162

6263
// When
@@ -76,8 +77,8 @@ describe('trust-on-first-use', function() {
7677
var driver;
7778

7879
it('should accept previously un-seen hosts', function(done) {
79-
// Assuming we only run this test on NodeJS
80-
if( !NodeChannel.available ) {
80+
// Assuming we only run this test on NodeJS with TOFU support
81+
if( !hasFeature("trust_on_first_use") ) {
8182
done();
8283
return;
8384
}
@@ -104,8 +105,8 @@ describe('trust-on-first-use', function() {
104105
});
105106

106107
it('should should give helpful error if database cert does not match stored certificate', function(done) {
107-
// Assuming we only run this test on NodeJS
108-
if( !NodeChannel.available ) {
108+
// Assuming we only run this test on NodeJS with TOFU support
109+
if( !hasFeature("trust_on_first_use") ) {
109110
done();
110111
return;
111112
}

0 commit comments

Comments
 (0)