2015-05-22 21:12:59 +02:00
|
|
|
'use strict';
|
|
|
|
|
2016-07-19 02:03:42 +05:30
|
|
|
const common = require('../common');
|
2017-10-06 10:32:00 -07:00
|
|
|
|
2017-07-01 02:29:09 +03:00
|
|
|
if (!common.hasCrypto)
|
2016-05-11 15:34:52 -04:00
|
|
|
common.skip('missing crypto');
|
2015-05-22 21:12:59 +02:00
|
|
|
|
2017-07-01 02:29:09 +03:00
|
|
|
const assert = require('assert');
|
|
|
|
const tls = require('tls');
|
2017-10-06 10:32:00 -07:00
|
|
|
|
|
|
|
const fixtures = require('../common/fixtures');
|
2015-05-22 21:12:59 +02:00
|
|
|
|
2017-01-08 13:19:00 +00:00
|
|
|
const server = tls.createServer({
|
2017-10-06 10:32:00 -07:00
|
|
|
key: fixtures.readKey('agent1-key.pem'),
|
|
|
|
cert: fixtures.readKey('agent1-cert.pem'),
|
2015-05-22 21:12:59 +02:00
|
|
|
rejectUnauthorized: true
|
|
|
|
}, function(c) {
|
2016-07-15 15:43:24 -04:00
|
|
|
}).listen(0, common.mustCall(function() {
|
2018-06-27 03:08:06 -04:00
|
|
|
assert.throws(() => {
|
|
|
|
tls.connect({
|
|
|
|
port: this.address().port,
|
2019-01-16 12:28:48 +01:00
|
|
|
ciphers: 'no-such-cipher'
|
2018-06-27 03:08:06 -04:00
|
|
|
}, common.mustNotCall());
|
|
|
|
}, /no cipher match/i);
|
2015-05-22 21:12:59 +02:00
|
|
|
|
2018-06-27 03:08:06 -04:00
|
|
|
server.close();
|
2016-07-15 15:43:24 -04:00
|
|
|
}));
|