TooTallNate / proxy-agents

Node.js HTTP Proxy Agents Monorepo
https://proxy-agents.n8.io
872 stars 229 forks source link

Can't set secureOptions #243

Open user9435213451 opened 10 months ago

user9435213451 commented 10 months ago

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

ciarans commented 9 months ago

Same here :(

vladkrasn commented 2 months ago

Same here!

vladkrasn commented 2 months ago

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

ekzyis commented 1 month ago

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

lukekarrys commented 1 month ago

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.