From 3d438f84b2f58234af57fd2e9e1e2153855031cb Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Sat, 23 Sep 2017 03:40:42 -0400 Subject: [PATCH] test: configure certs in tests OpenSSL 1.1.0 disables anonymous ciphers unless building with enable-weak-crypto. Avoid unnecessary dependencies on these ciphers in tests. PR-URL: https://github.com/nodejs/node/pull/16130 Reviewed-By: Ben Noordhuis Reviewed-By: Rod Vagg --- test/parallel/test-https-connect-address-family.js | 8 +++++--- test/parallel/test-tls-connect-address-family.js | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-https-connect-address-family.js b/test/parallel/test-https-connect-address-family.js index a345a70a57074b..28d47b3a967424 100644 --- a/test/parallel/test-https-connect-address-family.js +++ b/test/parallel/test-https-connect-address-family.js @@ -7,12 +7,15 @@ if (!common.hasIPv6) common.skip('no IPv6 support'); const assert = require('assert'); +const fixtures = require('../common/fixtures'); const https = require('https'); const dns = require('dns'); function runTest() { - const ciphers = 'AECDH-NULL-SHA'; - https.createServer({ ciphers }, common.mustCall(function(req, res) { + https.createServer({ + cert: fixtures.readKey('agent1-cert.pem'), + key: fixtures.readKey('agent1-key.pem'), + }, common.mustCall(function(req, res) { this.close(); res.end(); })).listen(0, '::1', common.mustCall(function() { @@ -20,7 +23,6 @@ function runTest() { host: 'localhost', port: this.address().port, family: 6, - ciphers: ciphers, rejectUnauthorized: false, }; // Will fail with ECONNREFUSED if the address family is not honored. diff --git a/test/parallel/test-tls-connect-address-family.js b/test/parallel/test-tls-connect-address-family.js index b0623c6cf603ec..75416c397d7c75 100644 --- a/test/parallel/test-tls-connect-address-family.js +++ b/test/parallel/test-tls-connect-address-family.js @@ -7,19 +7,21 @@ if (!common.hasIPv6) common.skip('no IPv6 support'); const assert = require('assert'); +const fixtures = require('../common/fixtures'); const tls = require('tls'); const dns = require('dns'); function runTest() { - const ciphers = 'AECDH-NULL-SHA'; - tls.createServer({ ciphers }, common.mustCall(function() { + tls.createServer({ + cert: fixtures.readKey('agent1-cert.pem'), + key: fixtures.readKey('agent1-key.pem'), + }, common.mustCall(function() { this.close(); })).listen(0, '::1', common.mustCall(function() { const options = { host: 'localhost', port: this.address().port, family: 6, - ciphers: ciphers, rejectUnauthorized: false, }; // Will fail with ECONNREFUSED if the address family is not honored.