From 1e1285926f35558f8ad1dad5fad2040ce576f46e Mon Sep 17 00:00:00 2001 From: Robert Jensen Date: Fri, 20 Sep 2019 14:15:16 -0400 Subject: tls: honor pauseOnConnect option `pauseOnConnect` is now passed along to the net.Socket constructor from the tls.Socket constructor. The `readable` flag must match the value of `pauseOnConnect`. Tests were added to cover all available net.Server options when used in the tls.Server constructor. Fixes: https://github.com/nodejs/node/issues/29620 Refs: https://github.com/nodejs/node/pull/27665 PR-URL: https://github.com/nodejs/node/pull/29635 Reviewed-By: Luigi Pinca --- lib/_tls_wrap.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index d29182d585..db6f6b5e76 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -411,7 +411,9 @@ function TLSSocket(socket, opts) { net.Socket.call(this, { handle: this._wrapHandle(wrap), allowHalfOpen: socket ? socket.allowHalfOpen : tlsOptions.allowHalfOpen, - readable: false, + pauseOnCreate: tlsOptions.pauseOnConnect, + // The readable flag is only needed if pauseOnCreate will be handled. + readable: tlsOptions.pauseOnConnect, writable: false }); @@ -926,7 +928,8 @@ function tlsConnectionListener(rawSocket) { handshakeTimeout: this[kHandshakeTimeout], ALPNProtocols: this.ALPNProtocols, SNICallback: this[kSNICallback] || SNICallback, - enableTrace: this[kEnableTrace] + enableTrace: this[kEnableTrace], + pauseOnConnect: this.pauseOnConnect, }); socket.on('secure', onServerSocketSecure); -- cgit v1.2.3