Fields
optionaltimeout:Null<Int>
A number specifying the socket timeout in milliseconds. This will set the timeout before the socket is connected.
optionalsocketPath:Null<String>
Unix Domain Socket (cannot be used if one of host or port is specified, those specify a TCP Socket).
optionalsocket:Null<Socket>
Establish secure connection on a given socket rather than creating a new socket.
If this option is specified, host
and port
are ignored.
optionalsetHost:Null<Bool>
Specifies whether or not to automatically add the Host header.
Defaults to true
.
optionalsessionIdContext:Null<String>
opaque identifier for session resumption.
If requestCert
is true, the default is MD5 hash value generated from command-line.
Otherwise, the default is not provided.
optionalsecureProtocol:Null<String>
The SSL method to use, e.g. SSLv3_method to force SSL version 3. The possible values depend on your installation of OpenSSL and are defined in the constant SSL_METHODS.
optionalrequestOCSP:Null<Bool>
If true - OCSP status request extension would be added to client hello, and OCSPResponse event will be emitted on socket before establishing secure communication
optionalrejectUnauthorized:Null<Bool>
If true the server will reject any connection which is not authorized with the list of supplied CAs.
This option only has an effect if requestCert
is true.
Default: false.
optionalpfx:Null<EitherType<String, Buffer>>
private key, certificate and CA certs of the server in PFX or PKCS12 format.
optionalpath:Null<String>
Request path. Should include query string if any. E.G. '/index.html?page=12'
.
An exception is thrown when the request path contains illegal characters.
Currently, only spaces are rejected but that may change in the future.
Default: '/'
.
optionalhostname:Null<String>
Alias for host
.
To support url.parse()
, hostname will be used if both host
and hostname
are specified.
optionalhost:Null<String>
A domain name or IP address of the server to issue the request to.
Default: 'localhost'
.
optionalhonorCipherOrder:Null<Bool>
When choosing a cipher, use the server's preferences instead of the client preferences. Default: true.
optionalheaders:Null<DynamicAccess<EitherType<String, Array<String>>>>
An object containing request headers.
optionalfamily:Null<DnsAddressFamily>
IP address family to use when resolving host
or hostname
.
Valid values are 4
or 6
. When unspecified, both IP v4 and v6 will be used.
optionalecdhCurve:Null<String>
named curve to use for ECDH key agreement or false to disable ECDH.
Defaults to prime256v1 (NIST P-256). Use Crypto.getCurves
to obtain a list of available curve names.
On recent releases, openssl ecparam -list_curves will also display the name and description
of each available elliptic curve.
optionaldhparam:Null<EitherType<String, Buffer>>
Diffie Hellman parameters, required for Perfect Forward Secrecy.
Use openssl dhparam to create it. Its key length should be greater than or equal to 1024 bits, otherwise it throws an error. It is strongly recommended to use 2048 bits or more for stronger security. If omitted or invalid, it is silently discarded and DHE ciphers won't be available.
optionaldefaultPort:Null<Int>
Default port for the protocol.
Default: agent.defaultPort
if an Agent is used, else undefined
.
optionalcreateConnection:Null<(options:SocketConnectOptionsTcp, callabck:(err:Error, stream:IDuplex) ‑> Void) ‑> IDuplex>
A function that produces a socket/stream to use for the request when the agent
option is not used.
This can be used to avoid creating a custom Agent
class just to override the default createConnection
function.
See agent.createConnection() for more details.
Any Duplex
stream is a valid return value.
optionalciphers:Null<String>
ciphers to use or exclude.
To mitigate BEAST attacks it is recommended that you use this option in conjunction with the honorCipherOrder
option described below to prioritize the non-CBC cipher.
Defaults to AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH.
Consult the OpenSSL cipher list format documentation for details on the format. ECDH (Elliptic Curve Diffie-Hellman) ciphers are not yet supported.
optionalcheckServerIdentity:Null<(String, {}) ‑> Dynamic>
An override for checking server's hostname against the certificate.
Should return an error if verification fails. Return js.Lib.undefined
if passing.
optionalca:Null<Array<EitherType<String, Buffer>>>
trusted certificates in PEM format. If this is omitted several well known "root" CAs will be used, like VeriSign. These are used to authorize connections.
optionalauth:Null<String>
Basic authentication i.e. 'user:password'
to compute an Authorization header.
optionalagent:Null<EitherType<Agent, Bool>>
optionalNPNProtocols:Null<EitherType<Array<String>, Buffer>>
possible NPN protocols. (Protocols should be ordered by their priority).