From caa7b343d428482269cbf25536f0b3feafd0e24b Mon Sep 17 00:00:00 2001 From: tigerbot Date: Wed, 21 Jun 2017 17:00:46 -0600 Subject: [PATCH] improved extraction of properties from TLS sockets --- lib/modules/tls.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/modules/tls.js b/lib/modules/tls.js index ece8cea..57f9042 100644 --- a/lib/modules/tls.js +++ b/lib/modules/tls.js @@ -9,14 +9,18 @@ module.exports.create = function (deps, config, netHandler) { function extractSocketProp(socket, propName) { // remoteAddress, remotePort... ugh... https://github.com/nodejs/node/issues/8854 - var value = socket[propName] || socket['_' + propName]; + var altName = '_' + propName; + var value = socket[propName] || socket[altName]; try { value = value || socket._handle._parent.owner.stream[propName]; + value = value || socket._handle._parent.owner.stream[altName]; } catch (e) {} try { value = value || socket._handle._parentWrap[propName]; + value = value || socket._handle._parentWrap[altName]; value = value || socket._handle._parentWrap._handle.owner.stream[propName]; + value = value || socket._handle._parentWrap._handle.owner.stream[altName]; } catch (e) {} return value || '';