mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
e151e909fd
Fixes: https://github.com/nodejs/node/issues/38305 PR-URL: https://github.com/nodejs/node/pull/38308 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
25 lines
617 B
JavaScript
25 lines
617 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
if (!common.hasCrypto) {
|
|
common.skip('missing crypto');
|
|
}
|
|
|
|
const assert = require('assert');
|
|
const tls = require('tls');
|
|
|
|
const server = new tls.Server();
|
|
|
|
[null, undefined, 0, 1, 1n, Symbol(), {}, [], true, false, '', () => {}]
|
|
.forEach((arg) =>
|
|
assert.throws(
|
|
() => server.setTicketKeys(arg),
|
|
{ code: 'ERR_INVALID_ARG_TYPE' }
|
|
));
|
|
|
|
[new Uint8Array(1), Buffer.from([1]), new DataView(new ArrayBuffer(2))].forEach(
|
|
(arg) =>
|
|
assert.throws(() => {
|
|
server.setTicketKeys(arg);
|
|
}, /Session ticket keys must be a 48-byte buffer/)
|
|
);
|