From 999fbe9d96cbdff9cd69f0d23c6671dc0d7f3e9e Mon Sep 17 00:00:00 2001 From: Brendan Ashworth Date: Fri, 13 Mar 2015 01:42:21 -0700 Subject: [PATCH] test: fix crypto-binary-default bad crypto check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/iojs/io.js/pull/1141 Reviewed-By: Johan Bergström --- test/parallel/test-crypto-binary-default.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/test/parallel/test-crypto-binary-default.js b/test/parallel/test-crypto-binary-default.js index 2efd3fa519d32b..dced72309371ab 100644 --- a/test/parallel/test-crypto-binary-default.js +++ b/test/parallel/test-crypto-binary-default.js @@ -11,6 +11,7 @@ if (!common.hasCrypto) { process.exit(); } var crypto = require('crypto'); +var tls = require('tls'); crypto.DEFAULT_ENCODING = 'binary'; @@ -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'});