Skip to content

Commit

Permalink
Remove servername check
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Feb 13, 2020
1 parent 8fdb1a5 commit 3d2981c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,10 @@ export default class HttpsProxyAgent extends Agent {
req.once('socket', resume);

if (opts.secureEndpoint) {
const servername = opts.servername || opts.host;
if (!servername) {
throw new Error('Could not determine "servername"');
}
// The proxy is connecting to a TLS server, so upgrade
// this socket connection to a TLS connection.
debug('Upgrading socket connection to TLS');
const servername = opts.servername || opts.host;
return tls.connect({
...omit(opts, 'host', 'hostname', 'path', 'port'),
socket,
Expand Down

0 comments on commit 3d2981c

Please sign in to comment.