0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-tls-server-setoptions-clientcertengine.js
cjihrig 246a6fc107
tls: deprecate Server.prototype.setOptions()
This function was undocumented and only used in one place
throughout the codebase, plus a test.

PR-URL: https://github.com/nodejs/node/pull/23820
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-10-25 15:34:53 -04:00

19 lines
541 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 = tls.createServer();
assert.strictEqual(server.clientCertEngine, undefined);
common.expectWarning('DeprecationWarning',
'Server.prototype.setOptions() is deprecated',
'DEP0122');
server.setOptions({ clientCertEngine: 'Cannonmouth' });
assert.strictEqual(server.clientCertEngine, 'Cannonmouth');
}