As stated in the documentation for https.request
:
The following additional
options
fromtls.connect()
are also accepted when using a customAgent
:ca
,cert
,ciphers
,clientCertEngine
,key
,passphrase
,pfx
,rejectUnauthorized
,secureProtocol
,servername
.
This module allows to modify other options, as well as to disable them. For example, SNI can be disabled by setting servername
to null
(or undefined
).
Install
$ npm i agent-options
Usage
makeAgent(agentOptions)
returnshttps.Agent
created with givenagentOptions
and ensures that thoseagentOptions
are used fortls.connect
as well (in a sense ofObject.assign
).makeAgent(agentOptions, connectOptions)
usesagentOptions
forhttps.Agent
(as is) andconnectOptions
fortls.connect
(again, withObject.assign
).
Examples
Performing https.request
without SNI:
const https = const makeAgent = const options = host: 'example.com' port: 443 path: '/' agent: const req = https req req
Same using got:
const got = const makeAgent =
Issues
- Support agents other than
https.Agent
?