From 69080f5474369fc7fc4be7ab74ad2e1619eb2fbc Mon Sep 17 00:00:00 2001 From: Timothy J Fontaine Date: Wed, 22 Oct 2014 12:14:10 -0700 Subject: [PATCH] tls: enforce secureOptions on incoming clients Reuse the secureProtocol and secureOptions of the server when creating the secure context for incoming clients. --- lib/tls.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/tls.js b/lib/tls.js index adc8efa634d..77a7089218b 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -1145,7 +1145,12 @@ function Server(/* [options], listener */) { // constructor call net.Server.call(this, function(socket) { - var creds = crypto.createCredentials(null, sharedCreds.context); + var connOps = { + secureProtocol: self.secureProtocol, + secureOptions: self.secureOptions + }; + + var creds = crypto.createCredentials(connOps, sharedCreds.context); var pair = new SecurePair(creds, true,