Skip to content

Commit

Permalink
test: fix crypto-binary-default bad crypto check
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
brendanashworth committed Mar 22, 2015
1 parent 99c79f8 commit 999fbe9
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions test/parallel/test-crypto-binary-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if (!common.hasCrypto) {
process.exit();
}
var crypto = require('crypto');
var tls = require('tls');

crypto.DEFAULT_ENCODING = 'binary';

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

// TODO(indutny): Move to a separate test eventually
try {
var context = tls.createSecureContext({
key: keyPem,
cert: certPem,
ca: caPem
});
} catch (e) {
console.log('Not compiled with OPENSSL support.');
process.exit();
}

// PFX tests
assert.doesNotThrow(function() {
tls.createSecureContext({pfx:certPfx, passphrase:'sample'});
Expand Down

0 comments on commit 999fbe9

Please sign in to comment.