Skip to content

Commit

Permalink
test: move require('https') to after crypto check
Browse files Browse the repository at this point in the history
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.<anonymous>
  (/node/test/parallel/test-https-client-override-global-agent.js:5:15)

This commit moves the require statement to after the crypto check.

PR-URL: #25388
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
danbev committed Jan 11, 2019
1 parent a55cddd commit 9abb646
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/parallel/test-https-client-override-global-agent.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const fixtures = require('../common/fixtures');
const assert = require('assert');
const https = require('https');

if (!common.hasCrypto)
common.skip('missing crypto');

// Disable strict server certificate validation by the client
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';

Expand Down

0 comments on commit 9abb646

Please sign in to comment.