1919var NodeChannel = require ( '../../lib/v1/internal/ch-node.js' ) ;
2020var neo4j = require ( "../../lib/v1" ) ;
2121var fs = require ( "fs" ) ;
22+ var hasFeature = require ( "../../lib/v1/internal/features" ) ;
2223
2324describe ( '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