Skip to content

Commit 3d2981c

Browse files
committed
Remove servername check
1 parent 8fdb1a5 commit 3d2981c

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/agent.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,10 @@ export default class HttpsProxyAgent extends Agent {
135135
req.once('socket', resume);
136136

137137
if (opts.secureEndpoint) {
138-
const servername = opts.servername || opts.host;
139-
if (!servername) {
140-
throw new Error('Could not determine "servername"');
141-
}
142138
// The proxy is connecting to a TLS server, so upgrade
143139
// this socket connection to a TLS connection.
144140
debug('Upgrading socket connection to TLS');
141+
const servername = opts.servername || opts.host;
145142
return tls.connect({
146143
...omit(opts, 'host', 'hostname', 'path', 'port'),
147144
socket,

0 commit comments

Comments
 (0)