• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2const common = require('../common');
3
4if (!common.hasCrypto)
5  common.skip('missing crypto');
6
7const assert = require('assert');
8const tls = require('tls');
9const fixtures = require('../common/fixtures');
10
11{
12  const options = {
13    key: fixtures.readKey('agent2-key.pem'),
14    cert: fixtures.readKey('agent2-cert.pem'),
15    ciphers: 'aes256-sha'
16  };
17  assert.throws(() => tls.createServer(options, common.mustNotCall()),
18                /no cipher match/i);
19  options.ciphers = 'FOOBARBAZ';
20  assert.throws(() => tls.createServer(options, common.mustNotCall()),
21                /no cipher match/i);
22  options.ciphers = 'TLS_not_a_cipher';
23  assert.throws(() => tls.createServer(options, common.mustNotCall()),
24                /no cipher match/i);
25}
26