summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/node/polyfills/_tls_wrap.ts3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/node/polyfills/_tls_wrap.ts b/ext/node/polyfills/_tls_wrap.ts
index 416bd4136..1e130a543 100644
--- a/ext/node/polyfills/_tls_wrap.ts
+++ b/ext/node/polyfills/_tls_wrap.ts
@@ -84,8 +84,7 @@ export class TLSSocket extends net.Socket {
constructor(socket: any, opts: any = kEmptyObject) {
const tlsOptions = { ...opts };
- let hostname = tlsOptions?.secureContext?.servername;
- hostname = opts.host;
+ const hostname = opts.servername ?? opts.host ?? socket._host;
tlsOptions.hostname = hostname;
const _cert = tlsOptions?.secureContext?.cert;