https.Agent
History
0 maxCachedSessions to disable TLS session caching.maxCachedSessions added to options for TLS sessions reuse.An Agent object for HTTPS similar to http.Agent. See
https.request() for more information.
Like http.Agent, the createConnection(options[, callback]) method can be overridden
to customize how TLS connections are established.
See
agent.createConnection()for details on overriding this method, including asynchronous socket creation with a callback.
new Agent(options?): Agent
Objecthttp.Agent(options), andnumber0 to disable TLS session caching. Default: 100.string'' to disable sending the extension.
Default: host name of the target server, unless the target server
is specified using an IP address, in which case the default is '' (no
extension).Requests that specify a custom checkServerIdentity option are not eligible
for connection reuse or TLS session reuse by an https.Agent, unless the
checkServerIdentity option was specified when constructing the Agent.
BufferSSLKEYLOGFILE format.tls.TLSSockettls.TLSSocket instance on which it was
generated.The keylog event is emitted when key material is generated or received by a
connection managed by this agent (typically before handshake has completed, but
not necessarily). This keying material can be stored for debugging, as it
allows captured TLS traffic to be decrypted. It may be emitted multiple times
for each socket.
A typical use case is to append received lines to a common text file, which is later used by software (such as Wireshark) to decrypt the traffic:
// ... https.globalAgent.on('keylog', (line, tlsSocket) => { fs.appendFileSync('/tmp/ssl-keys.log', line, { mode: 0o600 }); });