File tree 1 file changed +20
-2
lines changed
packages/neo4j-driver/test
1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,11 @@ export default async function execute () {
65
65
const LOGGING_ENABLED = fromEnvOrDefault ( 'STRESS_TEST_LOGGING_ENABLED' , false )
66
66
67
67
const config = {
68
- logging : neo4j . logging . console ( LOGGING_ENABLED ? 'debug' : 'info' ) ,
69
- encrypted : isRemoteCluster ( )
68
+ logging : neo4j . logging . console ( LOGGING_ENABLED ? 'debug' : 'info' )
69
+ }
70
+
71
+ if ( isSslSchemeNotSet ( ) ) {
72
+ config . encrypted = isRemoteCluster ( )
70
73
}
71
74
72
75
const driver = neo4j . driver (
@@ -134,6 +137,21 @@ function isRemoteCluster () {
134
137
return fromEnvOrDefault ( 'STRESS_TEST_DATABASE_URI' ) !== undefined
135
138
}
136
139
140
+ function isSslSchemeNotSet ( uri ) {
141
+ function extractScheme ( scheme ) {
142
+ if ( scheme ) {
143
+ scheme = scheme . trim ( )
144
+ if ( scheme . charAt ( scheme . length - 1 ) === ':' ) {
145
+ scheme = scheme . substring ( 0 , scheme . length - 1 )
146
+ }
147
+ return scheme
148
+ }
149
+ return null
150
+ }
151
+ const scheme = extractScheme ( uri )
152
+ return scheme === null || scheme === 'bolt' || scheme === 'neo4j'
153
+ }
154
+
137
155
function isCluster ( ) {
138
156
return sharedNeo4j . cluster || isRemoteCluster ( )
139
157
}
You can’t perform that action at this time.
0 commit comments