Skip to content

Commit cf646a1

Browse files
authored
testkit-backend: Test only the TLS versions available in the system (#799)
1 parent a29020d commit cf646a1

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

packages/testkit-backend/src/request-handlers.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ import neo4j from './neo4j'
22
import ResultObserver from './result-observer.js'
33
import { cypherToNative, nativeToCypher } from './cypher-native-binders.js'
44
import { shouldRunTest } from './skipped-tests'
5+
import tls from 'tls'
6+
7+
const SUPPORTED_TLS = (() => {
8+
const min = Number(tls.DEFAULT_MIN_VERSION.split('TLSv')[1])
9+
const max = Number(tls.DEFAULT_MAX_VERSION.split('TLSv')[1])
10+
const result = [];
11+
for (let version = min; version <= max; version = Number((version + 0.1).toFixed(1)) ) {
12+
result.push(`Feature:TLS:${version.toFixed(1)}`)
13+
}
14+
return result;
15+
})();
516

617
export function NewDriver (context, data, { writeResponse }) {
718
const {
@@ -268,7 +279,8 @@ export function GetFeatures (_context, _params, wire) {
268279
'AuthorizationExpiredTreatment',
269280
'ConfHint:connection.recv_timeout_seconds',
270281
'Feature:Bolt:4.4',
271-
'Feature:Impersonation'
282+
'Feature:Impersonation',
283+
...SUPPORTED_TLS
272284
]
273285
})
274286
}

0 commit comments

Comments
 (0)