Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
Simpler servername
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Feb 13, 2020
1 parent c9b852e commit 8ed8efa
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 @@ -167,13 +167,10 @@ export default class SocksProxyAgent extends Agent {
debug('Successfully created socks proxy connection');

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 || host;
return tls.connect({
...omit(opts, 'host', 'hostname', 'path', 'port'),
socket,
Expand Down

0 comments on commit 8ed8efa

Please sign in to comment.