19
19
var NodeChannel = require ( '../../lib/v1/internal/ch-node.js' ) ;
20
20
var neo4j = require ( "../../lib/v1" ) ;
21
21
var fs = require ( "fs" ) ;
22
+ var hasFeature = require ( "../../lib/v1/internal/features" ) ;
22
23
23
24
describe ( 'trust-signed-certificates' , function ( ) {
24
25
@@ -46,7 +47,7 @@ describe('trust-signed-certificates', function() {
46
47
} ) ;
47
48
48
49
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
50
51
if ( ! NodeChannel . available ) {
51
52
done ( ) ;
52
53
return ;
@@ -56,7 +57,7 @@ describe('trust-signed-certificates', function() {
56
57
driver = neo4j . driver ( "bolt://localhost" , neo4j . auth . basic ( "neo4j" , "neo4j" ) , {
57
58
encrypted : true ,
58
59
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" ]
60
61
} ) ;
61
62
62
63
// When
@@ -76,8 +77,8 @@ describe('trust-on-first-use', function() {
76
77
var driver ;
77
78
78
79
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" ) ) {
81
82
done ( ) ;
82
83
return ;
83
84
}
@@ -104,8 +105,8 @@ describe('trust-on-first-use', function() {
104
105
} ) ;
105
106
106
107
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" ) ) {
109
110
done ( ) ;
110
111
return ;
111
112
}
0 commit comments