Skip to content

Commit 388d670

Browse files
authored
tls: make server.prototype.setOptions end-of-life
PR-URL: #57339 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
1 parent 2eea453 commit 388d670

File tree

3 files changed

+4
-67
lines changed

3 files changed

+4
-67
lines changed

doc/api/deprecations.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -2563,12 +2563,15 @@ generally useful and is being removed. See discussion here:
25632563

25642564
<!-- YAML
25652565
changes:
2566+
- version: REPLACEME
2567+
pr-url: https://github.com/nodejs/node/pull/57339
2568+
description: End-of-Life.
25662569
- version: v12.0.0
25672570
pr-url: https://github.com/nodejs/node/pull/23820
25682571
description: Runtime deprecation.
25692572
-->
25702573

2571-
Type: Runtime
2574+
Type: End-of-Life
25722575

25732576
Please use `Server.prototype.setSecureContext()` instead.
25742577

lib/_tls_wrap.js

-48
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ const {
3333

3434
const {
3535
assertCrypto,
36-
deprecate,
3736
kEmptyObject,
3837
} = require('internal/util');
3938

@@ -1537,53 +1536,6 @@ Server.prototype.setTicketKeys = function setTicketKeys(keys) {
15371536
this._sharedCreds.context.setTicketKeys(keys);
15381537
};
15391538

1540-
1541-
Server.prototype.setOptions = deprecate(function(options) {
1542-
this.requestCert = options.requestCert === true;
1543-
this.rejectUnauthorized = options.rejectUnauthorized !== false;
1544-
1545-
if (options.pfx) this.pfx = options.pfx;
1546-
if (options.key) this.key = options.key;
1547-
if (options.passphrase) this.passphrase = options.passphrase;
1548-
if (options.cert) this.cert = options.cert;
1549-
if (options.clientCertEngine)
1550-
this.clientCertEngine = options.clientCertEngine;
1551-
if (options.ca) this.ca = options.ca;
1552-
if (options.minVersion) this.minVersion = options.minVersion;
1553-
if (options.maxVersion) this.maxVersion = options.maxVersion;
1554-
if (options.secureProtocol) this.secureProtocol = options.secureProtocol;
1555-
if (options.crl) this.crl = options.crl;
1556-
if (options.ciphers) this.ciphers = options.ciphers;
1557-
if (options.ecdhCurve !== undefined)
1558-
this.ecdhCurve = options.ecdhCurve;
1559-
if (options.dhparam) this.dhparam = options.dhparam;
1560-
if (options.sessionTimeout) this.sessionTimeout = options.sessionTimeout;
1561-
if (options.ticketKeys) this.ticketKeys = options.ticketKeys;
1562-
const secureOptions = options.secureOptions || 0;
1563-
if (options.honorCipherOrder !== undefined)
1564-
this.honorCipherOrder = !!options.honorCipherOrder;
1565-
else
1566-
this.honorCipherOrder = true;
1567-
if (secureOptions) this.secureOptions = secureOptions;
1568-
if (options.ALPNProtocols)
1569-
tls.convertALPNProtocols(options.ALPNProtocols, this);
1570-
if (options.sessionIdContext) {
1571-
this.sessionIdContext = options.sessionIdContext;
1572-
} else {
1573-
this.sessionIdContext = crypto.createHash('sha1')
1574-
.update(process.argv.join(' '))
1575-
.digest('hex')
1576-
.slice(0, 32);
1577-
}
1578-
if (options.pskCallback) this[kPskCallback] = options.pskCallback;
1579-
if (options.pskIdentityHint) this[kPskIdentityHint] = options.pskIdentityHint;
1580-
if (options.sigalgs) this.sigalgs = options.sigalgs;
1581-
if (options.privateKeyIdentifier !== undefined)
1582-
this.privateKeyIdentifier = options.privateKeyIdentifier;
1583-
if (options.privateKeyEngine !== undefined)
1584-
this.privateKeyEngine = options.privateKeyEngine;
1585-
}, 'Server.prototype.setOptions() is deprecated', 'DEP0122');
1586-
15871539
// SNI Contexts High-Level API
15881540
Server.prototype.addContext = function(servername, context) {
15891541
if (!servername) {

test/parallel/test-tls-server-setoptions-clientcertengine.js

-18
This file was deleted.

0 commit comments

Comments
 (0)