Closed gajus closed 1 year ago
Looking at the source code, there appears to be no way to pass custom options to the upgrade phase connection.
This behavior changed over time because of agent-base being reworked. Try running your snipped with https-proxy-agent@2.2.4
. You'll see that the ciphers
option is passed on to the tls.connect
call that upgrades the socket.
This issue is related to #92. Officially agent-base
only supports a timeout
option, but in reality agent-base@5
applies all of its constructor options to new requests. Because inheritance of the base agent is currently broken (again, see #92), your cipher
option is not being passed to tls.connect
. It looks like @TooTallNate made recent changes to agent-base
, and once updated to v6+, agent-base
will no longer apply its constructor options to requests.
You should pass the ciphers
option directly to got
. You can still provide ciphers
as an https-proxy-agent
option if you want it to be used when connecting to an HTTPS proxy server.
import url from 'url';
import crypto from 'crypto';
import got from 'got';
import Agent from 'https-proxy-agent';
(async () => {
const response = (await got('https://www.howsmyssl.com/a/check', {
agent: new Agent({
...url.parse('http://[..]'),
}),
ciphers: crypto.constants.defaultCipherList + ':!ECDHE+SHA:!AES128-SHA',
responseType: 'json',
})).body;
console.log(response.given_cipher_suites.length);
})();
This module has gone through a large refactor and modernization. I am closing this issue as a bit of house cleaning. If you feel that this issue still exists in the latest release, feel free to open a new issue.
still an issue
Changing
ciphers
configuration has no effect.