proxy-agents icon indicating copy to clipboard operation
proxy-agents copied to clipboard

Can't set secureOptions

Open user9435213451 opened this issue 2 years ago • 5 comments

When im using https.agent, setting secureOptions works fine. But in HttpsProxyAgent it does just nothing and I'm still getting "unsafe legacy renegotiation disabled" error. Please fix it, i need to use proxy and can't switch to basic https.agent

user9435213451 avatar Aug 29 '23 20:08 user9435213451

Same here :(

ciarans avatar Sep 26 '23 10:09 ciarans

Same here!

vladkrasn avatar Apr 11 '24 07:04 vladkrasn

Managed to get rid of my "unsafe legacy renegotiation disabled" error using this:

import { constants } from "node:crypto";
import { HttpsProxyAgent } from "https-proxy-agent";

const proxyAgent = new HttpsProxyAgent(`http://one:123`);
proxyAgent.connectOpts.secureOptions = constants.SSL_OP_LEGACY_SERVER_CONNECT;
proxyAgent.options.secureOptions = constants.SSL_OP_LEGACY_SERVER_CONNECT;

Still, it's weird that this project doesn't mirror all the constructor properties of https.agent

vladkrasn avatar Apr 11 '24 10:04 vladkrasn

HttpsProxyAgent uses http.Agent under the hood as mentioned in the README:

This module provides an http.Agent implementation that connects to a specified HTTP or HTTPS proxy server

ekzyis avatar Apr 30 '24 20:04 ekzyis

Still, it's weird that this project doesn't mirror all the constructor properties of https.agent

I opened #304 about parity between a possible https base agent and the core https agent in Node. It would be good to get more use cases in that issue to decide if it's worth working on.

lukekarrys avatar May 01 '24 16:05 lukekarrys