I need to set a client certificate to connect to our service, when using a proxy the connection fails.
new HttpsProxyAgent(process.env.HTTPS_PROXY, { pfx: buffer })
My perfered option would be to have second argument to the HttpsProxyAgent class with upgradeOpts.
new HttpsProxyAgent(process.env.HTTPS_PROXY, {}, { pfx: buffer })
When upgrading the connection these could be used with the regular options:
With the new argument it would be even possible to connect to a https proxy with a client certificate and to the remote server with another client certificate. When using the original connectOpts setting a client certificate might disturb the connection to the proxy server.
I need to set a client certificate to connect to our service, when using a proxy the connection fails.
new HttpsProxyAgent(process.env.HTTPS_PROXY, { pfx: buffer })
These
connectOpts
options are only used to connect, but when the connection is upgraded theconnectOpts
are ignored. https://github.com/TooTallNate/proxy-agents/blob/e1e80ab78cef88fd1e800b07611581dce3142550/packages/https-proxy-agent/src/index.ts#L144-L148My perfered option would be to have second argument to the HttpsProxyAgent class with
upgradeOpts
.new HttpsProxyAgent(process.env.HTTPS_PROXY, {}, { pfx: buffer })
When upgrading the connection these could be used with the regular options:
With the new argument it would be even possible to connect to a https proxy with a client certificate and to the remote server with another client certificate. When using the original
connectOpts
setting a client certificate might disturb the connection to the proxy server.