Skip to content

Commit 3d438f8

Browse files
davidbenevanlucas
authored andcommitted
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

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

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

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

99
constassert=require('assert');
10+
constfixtures=require('../common/fixtures');
1011
consthttps=require('https');
1112
constdns=require('dns');
1213

1314
functionrunTest(){
14-
constciphers='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
constoptions={
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‎

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

99
constassert=require('assert');
10+
constfixtures=require('../common/fixtures');
1011
consttls=require('tls');
1112
constdns=require('dns');
1213

1314
functionrunTest(){
14-
constciphers='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
constoptions={
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)