Skip to content

Commit 999fbe9

Browse files
test: fix crypto-binary-default bad crypto check
This commit fixes a small bug introduced in 671fbd5 that caused the test to not be run. crypto was properly checked, but since tls was not imported, a TypeError would be thrown in the `try {} catch {}` block and falsely reported as no crypto. This is now fixed. PR-URL: #1141 Reviewed-By: Johan Bergström <[email protected]>
1 parent 99c79f8 commit 999fbe9

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

test/parallel/test-crypto-binary-default.js

+1-12
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ if (!common.hasCrypto) {
1111
process.exit();
1212
}
1313
var crypto = require('crypto');
14+
var tls = require('tls');
1415

1516
crypto.DEFAULT_ENCODING = 'binary';
1617

@@ -27,18 +28,6 @@ var rsaPubPem = fs.readFileSync(common.fixturesDir + '/test_rsa_pubkey.pem',
2728
var rsaKeyPem = fs.readFileSync(common.fixturesDir + '/test_rsa_privkey.pem',
2829
'ascii');
2930

30-
// TODO(indutny): Move to a separate test eventually
31-
try {
32-
var context = tls.createSecureContext({
33-
key: keyPem,
34-
cert: certPem,
35-
ca: caPem
36-
});
37-
} catch (e) {
38-
console.log('Not compiled with OPENSSL support.');
39-
process.exit();
40-
}
41-
4231
// PFX tests
4332
assert.doesNotThrow(function() {
4433
tls.createSecureContext({pfx:certPfx, passphrase:'sample'});

0 commit comments

Comments
 (0)