diff options
author | Yuval Brik <yuval@brik.org.il> | 2015-08-30 00:27:14 +0300 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2015-10-20 16:14:22 -0400 |
commit | adfd20b6fd90b2c068a6d34886370b5e78175988 (patch) | |
tree | 5635f63c786af592e5ddb81a1be2cd945397c793 /lib/_tls_wrap.js | |
parent | b78de124d6d73014bf0bc5e386ad5d1288727a83 (diff) | |
download | android-node-v8-adfd20b6fd90b2c068a6d34886370b5e78175988.tar.gz android-node-v8-adfd20b6fd90b2c068a6d34886370b5e78175988.tar.bz2 android-node-v8-adfd20b6fd90b2c068a6d34886370b5e78175988.zip |
tls: TLSSocket options default isServer false
Upon creating a TLSSocket object, set the default isServer option to false
Updated tls docs and added test-tls-socket-default-options
PR-URL: https://github.com/nodejs/node/pull/2614
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'lib/_tls_wrap.js')
-rw-r--r-- | lib/_tls_wrap.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 6a1c295ce3..f027347177 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -228,7 +228,10 @@ function initRead(tls, wrapped) { */ function TLSSocket(socket, options) { - this._tlsOptions = options; + if (options === undefined) + this._tlsOptions = {}; + else + this._tlsOptions = options; this._secureEstablished = false; this._securePending = false; this._newSessionPending = false; @@ -321,7 +324,7 @@ TLSSocket.prototype._wrapHandle = function(wrap) { tls.createSecureContext(); res = tls_wrap.wrap(handle._externalStream, context.context, - options.isServer); + !!options.isServer); res._parent = handle; res._parentWrap = wrap; res._secureContext = context; |