aboutsummaryrefslogtreecommitdiff
path: root/lib/_tls_wrap.js
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2018-10-22 15:17:06 -0400
committercjihrig <cjihrig@gmail.com>2018-10-25 15:34:53 -0400
commit246a6fc1078ae3ef257169847704dd8db4122095 (patch)
tree50fa042309f471bad5f865bd3b8335e7dd9ab5f3 /lib/_tls_wrap.js
parentd8924a0160b395025648f15b2a812596c2f19d3d (diff)
downloadandroid-node-v8-246a6fc1078ae3ef257169847704dd8db4122095.tar.gz
android-node-v8-246a6fc1078ae3ef257169847704dd8db4122095.tar.bz2
android-node-v8-246a6fc1078ae3ef257169847704dd8db4122095.zip
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>
Diffstat (limited to 'lib/_tls_wrap.js')
-rw-r--r--lib/_tls_wrap.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js
index aa8b66b715..f0d86f3d87 100644
--- a/lib/_tls_wrap.js
+++ b/lib/_tls_wrap.js
@@ -827,16 +827,19 @@ function Server(options, listener) {
throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);
}
-
this._contexts = [];
+ this.requestCert = options.requestCert === true;
+ this.rejectUnauthorized = options.rejectUnauthorized !== false;
- // Handle option defaults:
- this.setOptions(options);
+ if (options.sessionTimeout)
+ this.sessionTimeout = options.sessionTimeout;
+
+ if (options.ticketKeys)
+ this.ticketKeys = options.ticketKeys;
+
+ if (options.ALPNProtocols)
+ tls.convertALPNProtocols(options.ALPNProtocols, this);
- // setSecureContext() overlaps with setOptions() quite a bit. setOptions()
- // is an undocumented API that was probably never intended to be exposed
- // publicly. Unfortunately, it would be a breaking change to just remove it,
- // and there is at least one test that depends on it.
this.setSecureContext(options);
this[kHandshakeTimeout] = options.handshakeTimeout || (120 * 1000);
@@ -998,7 +1001,7 @@ Server.prototype.setTicketKeys = function setTicketKeys(keys) {
};
-Server.prototype.setOptions = function(options) {
+Server.prototype.setOptions = util.deprecate(function(options) {
this.requestCert = options.requestCert === true;
this.rejectUnauthorized = options.rejectUnauthorized !== false;
@@ -1033,7 +1036,7 @@ Server.prototype.setOptions = function(options) {
.digest('hex')
.slice(0, 32);
}
-};
+}, 'Server.prototype.setOptions() is deprecated', 'DEP0122');
// SNI Contexts High-Level API
Server.prototype.addContext = function(servername, context) {