Skip to content

Commit f99f704

Browse files
committed
Remove feature detection of TRUST_ALL_CERTIFICATES
It requires `TlsSocket.getPeerCertificate()` function to work, which is available since Node v0.11.4.
1 parent 3fad54f commit f99f704

File tree

3 files changed

+2
-47
lines changed

3 files changed

+2
-47
lines changed

src/v1/internal/feature.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/v1/internal/node/node-channel.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {EOL} from 'os';
2626
import NodeBuffer from './node-buf';
2727
import {ENCRYPTION_OFF, ENCRYPTION_ON, isEmptyObjectOrNull} from '../util';
2828
import {newError} from '../../error';
29-
import Feature from '../feature';
3029

3130
let _CONNECTION_IDGEN = 0;
3231

@@ -263,7 +262,7 @@ function connect( config, onSuccess, onFailure=(()=>null) ) {
263262

264263
function isEncrypted(config) {
265264
const encryptionNotConfigured = config.encrypted == null || config.encrypted === undefined;
266-
if (encryptionNotConfigured && Feature.trustAllCertificatesAvailable()) {
265+
if (encryptionNotConfigured) {
267266
// default to using encryption if trust-all-certificates is available
268267
return true;
269268
}
@@ -274,8 +273,7 @@ function trustStrategyName(config) {
274273
if (config.trust) {
275274
return config.trust;
276275
}
277-
// default to using TRUST_ALL_CERTIFICATES if it is available
278-
return Feature.trustAllCertificatesAvailable() ? 'TRUST_ALL_CERTIFICATES' : 'TRUST_CUSTOM_CA_SIGNED_CERTIFICATES';
276+
return 'TRUST_ALL_CERTIFICATES';
279277
}
280278

281279
/**

test/internal/node/tls.test.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import neo4j from '../../../src/v1';
2121
import fs from 'fs';
2222
import path from 'path';
23-
import Feature from '../../../src/v1/internal/feature';
2423
import sharedNeo4j from '../shared-neo4j';
2524

2625
describe('trust-signed-certificates', () => {
@@ -90,12 +89,6 @@ describe('trust-all-certificates', () => {
9089
});
9190

9291
it('should work with default certificate', done => {
93-
// Assuming we only run this test on NodeJS with TAC support
94-
if (!Feature.trustAllCertificatesAvailable()) {
95-
done();
96-
return;
97-
}
98-
9992
// Given
10093
driver = neo4j.driver("bolt://localhost", sharedNeo4j.authToken, {
10194
encrypted: "ENCRYPTION_ON",

0 commit comments

Comments
 (0)