11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ciconst common = require('../common'); 31cb0ef41Sopenharmony_ci 41cb0ef41Sopenharmony_ciif (!common.hasCrypto) 51cb0ef41Sopenharmony_ci common.skip('missing crypto'); 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ciconst assert = require('assert'); 81cb0ef41Sopenharmony_ciconst tls = require('tls'); 91cb0ef41Sopenharmony_ciconst fixtures = require('../common/fixtures'); 101cb0ef41Sopenharmony_ci 111cb0ef41Sopenharmony_ci{ 121cb0ef41Sopenharmony_ci const options = { 131cb0ef41Sopenharmony_ci key: fixtures.readKey('agent2-key.pem'), 141cb0ef41Sopenharmony_ci cert: fixtures.readKey('agent2-cert.pem'), 151cb0ef41Sopenharmony_ci ciphers: 'aes256-sha' 161cb0ef41Sopenharmony_ci }; 171cb0ef41Sopenharmony_ci assert.throws(() => tls.createServer(options, common.mustNotCall()), 181cb0ef41Sopenharmony_ci /no[_ ]cipher[_ ]match/i); 191cb0ef41Sopenharmony_ci options.ciphers = 'FOOBARBAZ'; 201cb0ef41Sopenharmony_ci assert.throws(() => tls.createServer(options, common.mustNotCall()), 211cb0ef41Sopenharmony_ci /no[_ ]cipher[_ ]match/i); 221cb0ef41Sopenharmony_ci options.ciphers = 'TLS_not_a_cipher'; 231cb0ef41Sopenharmony_ci assert.throws(() => tls.createServer(options, common.mustNotCall()), 241cb0ef41Sopenharmony_ci /no[_ ]cipher[_ ]match/i); 251cb0ef41Sopenharmony_ci} 26