Skip to content

Commit

Permalink
fix(proxy-agent): add fallback value for servername when using reques…
Browse files Browse the repository at this point in the history
…tTls

fixes #3988
  • Loading branch information
Viiprogrammer committed Jan 5, 2025
1 parent 54c5c68 commit e8473e6
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/dispatcher/proxy-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,7 @@ class ProxyAgent extends DispatcherBase {
callback(null, socket)
return
}
let servername
if (this[kRequestTls]) {
servername = this[kRequestTls].servername
} else {
servername = opts.servername
}
const servername = this[kRequestTls]?.servername || opts.servername
this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)
} catch (err) {
if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {
Expand Down

0 comments on commit e8473e6

Please sign in to comment.