From 09cda82e6aa3e27d75c51c68c8ef3b7ffd9889f2 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 8 Jan 2019 07:39:56 +0100 Subject: [PATCH 1/2] test: move require('https') to after crypto check Currently, test-https-client-override-global-agent.js fails with the following error when configured --without-ssl: Error [ERR_NO_CRYPTO]: Node.js is not compiled with OpenSSL crypto support at Object.assertCrypto (internal/util.js:101:11) ... at Object. (/node/test/parallel/test-https-client-override-global-agent.js:5:15) This commit moves the require statement to after the crypto check. --- test/parallel/test-https-client-override-global-agent.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-https-client-override-global-agent.js b/test/parallel/test-https-client-override-global-agent.js index 12b5ae596bc837..43c962438442b3 100644 --- a/test/parallel/test-https-client-override-global-agent.js +++ b/test/parallel/test-https-client-override-global-agent.js @@ -2,11 +2,12 @@ const common = require('../common'); const fixtures = require('../common/fixtures'); const assert = require('assert'); -const https = require('https'); if (!common.hasCrypto) common.skip('missing crypto'); +const https = require('https'); + // Disable strict server certificate validation by the client process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; From 3ad31a9a2d2fce6d2900e44adabf98914f95bd42 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 8 Jan 2019 09:06:58 +0100 Subject: [PATCH 2/2] squash! move hasCrypto straight after common req --- test/parallel/test-https-client-override-global-agent.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-https-client-override-global-agent.js b/test/parallel/test-https-client-override-global-agent.js index 43c962438442b3..0aaab0d7b3ef96 100644 --- a/test/parallel/test-https-client-override-global-agent.js +++ b/test/parallel/test-https-client-override-global-agent.js @@ -1,11 +1,9 @@ 'use strict'; const common = require('../common'); -const fixtures = require('../common/fixtures'); -const assert = require('assert'); - if (!common.hasCrypto) common.skip('missing crypto'); - +const fixtures = require('../common/fixtures'); +const assert = require('assert'); const https = require('https'); // Disable strict server certificate validation by the client