summaryrefslogtreecommitdiff
path: root/lib/_tls_wrap.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/_tls_wrap.js')
-rw-r--r--lib/_tls_wrap.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js
index fc515bbc3..3f017e1e1 100644
--- a/lib/_tls_wrap.js
+++ b/lib/_tls_wrap.js
@@ -177,8 +177,8 @@ function TLSSocket(socket, options) {
net.Socket.call(this, {
handle: socket && socket._handle,
allowHalfOpen: socket && socket.allowHalfOpen,
- readable: true,
- writable: true
+ readable: false,
+ writable: false
});
// To prevent assertion in afterConnect()
@@ -210,6 +210,13 @@ function TLSSocket(socket, options) {
} else {
this._init(socket);
}
+
+ // Make sure to setup all required properties like: `_connecting` before
+ // starting the flow of the data
+ this.readable = true;
+ this.writable = true;
+ if (this.readable)
+ this.read(0);
}
util.inherits(TLSSocket, net.Socket);
exports.TLSSocket = TLSSocket;