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 <info@bnoordhuis.nl> Reviewed-By: Rod Vagg <rod@vagg.org>
This commit is contained in:
parent
f7410405e4
commit
e433afa652
@ -7,12 +7,15 @@ if (!common.hasIPv6)
|
|||||||
common.skip('no IPv6 support');
|
common.skip('no IPv6 support');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
const fixtures = require('../common/fixtures');
|
||||||
const https = require('https');
|
const https = require('https');
|
||||||
const dns = require('dns');
|
const dns = require('dns');
|
||||||
|
|
||||||
function runTest() {
|
function runTest() {
|
||||||
const ciphers = 'AECDH-NULL-SHA';
|
https.createServer({
|
||||||
https.createServer({ ciphers }, common.mustCall(function(req, res) {
|
cert: fixtures.readKey('agent1-cert.pem'),
|
||||||
|
key: fixtures.readKey('agent1-key.pem'),
|
||||||
|
}, common.mustCall(function(req, res) {
|
||||||
this.close();
|
this.close();
|
||||||
res.end();
|
res.end();
|
||||||
})).listen(0, '::1', common.mustCall(function() {
|
})).listen(0, '::1', common.mustCall(function() {
|
||||||
@ -20,7 +23,6 @@ function runTest() {
|
|||||||
host: 'localhost',
|
host: 'localhost',
|
||||||
port: this.address().port,
|
port: this.address().port,
|
||||||
family: 6,
|
family: 6,
|
||||||
ciphers: ciphers,
|
|
||||||
rejectUnauthorized: false,
|
rejectUnauthorized: false,
|
||||||
};
|
};
|
||||||
// Will fail with ECONNREFUSED if the address family is not honored.
|
// Will fail with ECONNREFUSED if the address family is not honored.
|
||||||
|
@ -7,19 +7,21 @@ if (!common.hasIPv6)
|
|||||||
common.skip('no IPv6 support');
|
common.skip('no IPv6 support');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
const fixtures = require('../common/fixtures');
|
||||||
const tls = require('tls');
|
const tls = require('tls');
|
||||||
const dns = require('dns');
|
const dns = require('dns');
|
||||||
|
|
||||||
function runTest() {
|
function runTest() {
|
||||||
const ciphers = 'AECDH-NULL-SHA';
|
tls.createServer({
|
||||||
tls.createServer({ ciphers }, common.mustCall(function() {
|
cert: fixtures.readKey('agent1-cert.pem'),
|
||||||
|
key: fixtures.readKey('agent1-key.pem'),
|
||||||
|
}, common.mustCall(function() {
|
||||||
this.close();
|
this.close();
|
||||||
})).listen(0, '::1', common.mustCall(function() {
|
})).listen(0, '::1', common.mustCall(function() {
|
||||||
const options = {
|
const options = {
|
||||||
host: 'localhost',
|
host: 'localhost',
|
||||||
port: this.address().port,
|
port: this.address().port,
|
||||||
family: 6,
|
family: 6,
|
||||||
ciphers: ciphers,
|
|
||||||
rejectUnauthorized: false,
|
rejectUnauthorized: false,
|
||||||
};
|
};
|
||||||
// Will fail with ECONNREFUSED if the address family is not honored.
|
// Will fail with ECONNREFUSED if the address family is not honored.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user