Skip to content

Commit 3d438f8

Browse files
davidbenevanlucas
authored andcommittedNov 13, 2017
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: #16130 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rod Vagg <rod@vagg.org>
1 parent 07102ac commit 3d438f8

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed
 

‎test/parallel/test-https-connect-address-family.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,22 @@ if (!common.hasIPv6)
77
common.skip('no IPv6 support');
88

99
const assert = require('assert');
10+
const fixtures = require('../common/fixtures');
1011
const https = require('https');
1112
const dns = require('dns');
1213

1314
function runTest() {
14-
const ciphers = 'AECDH-NULL-SHA';
15-
https.createServer({ ciphers }, common.mustCall(function(req, res) {
15+
https.createServer({
16+
cert: fixtures.readKey('agent1-cert.pem'),
17+
key: fixtures.readKey('agent1-key.pem'),
18+
}, common.mustCall(function(req, res) {
1619
this.close();
1720
res.end();
1821
})).listen(0, '::1', common.mustCall(function() {
1922
const options = {
2023
host: 'localhost',
2124
port: this.address().port,
2225
family: 6,
23-
ciphers: ciphers,
2426
rejectUnauthorized: false,
2527
};
2628
// Will fail with ECONNREFUSED if the address family is not honored.

‎test/parallel/test-tls-connect-address-family.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,21 @@ if (!common.hasIPv6)
77
common.skip('no IPv6 support');
88

99
const assert = require('assert');
10+
const fixtures = require('../common/fixtures');
1011
const tls = require('tls');
1112
const dns = require('dns');
1213

1314
function runTest() {
14-
const ciphers = 'AECDH-NULL-SHA';
15-
tls.createServer({ ciphers }, common.mustCall(function() {
15+
tls.createServer({
16+
cert: fixtures.readKey('agent1-cert.pem'),
17+
key: fixtures.readKey('agent1-key.pem'),
18+
}, common.mustCall(function() {
1619
this.close();
1720
})).listen(0, '::1', common.mustCall(function() {
1821
const options = {
1922
host: 'localhost',
2023
port: this.address().port,
2124
family: 6,
22-
ciphers: ciphers,
2325
rejectUnauthorized: false,
2426
};
2527
// Will fail with ECONNREFUSED if the address family is not honored.

0 commit comments

Comments
 (0)
Please sign in to comment.