Skip to content

Commit 85e07a2

Browse files
committed
https-proxy-agent: augment the opts object for the tls.connect function
So that any additional options get picked up.
1 parent 43be0ab commit 85e07a2

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

https-proxy-agent.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,12 @@ function connect (req, opts, fn) {
8585
if (self.secureEndpoint) {
8686
// since the proxy is connecting to an SSL server, we have
8787
// to upgrade this socket connection to an SSL connection
88-
sock = tls.connect({
89-
socket: socket,
90-
servername: opts.host
91-
});
88+
opts.socket = socket;
89+
opts.servername = opts.host;
90+
opts.host = null;
91+
opts.hostname = null;
92+
opts.port = null;
93+
sock = tls.connect(opts);
9294
}
9395

9496
fn(null, sock);

0 commit comments

Comments
 (0)