chunk_id large_stringlengths 36 36 | doc_type large_stringclasses 2
values | category large_stringclasses 17
values | document large_stringclasses 50
values | version_raw large_stringclasses 590
values | chunk_index int64 0 262 | text large_stringlengths 11 5.69k | file_path large_stringclasses 882
values |
|---|---|---|---|---|---|---|---|
9b49c0cf-8457-5951-af6d-fd83a9cc8c4f | docs | nodejs | nodejs_tls | 012x | 8 | `ECDHE-RSA-AES128-SHA256`, `DHE-RSA-AES128-SHA256` and
`AES128-GCM-SHA256` are TLS v1.2 ciphers and used when Node.js is
linked against OpenSSL 1.0.1 or newer, such as the bundled version
of OpenSSL. Note that it is still possible for a TLS v1.2 client
to negotiate a weaker cipher unless `honorCipherOrder` is... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
72349e59-16ec-588d-9994-d397302f7a29 | docs | nodejs | nodejs_tls | 012x | 9 | Defaults to `prime256v1`. Consult [RFC 4492](http://www.rfc-editor.org/rfc/rfc4492.txt) for more details.
* `dhparam`: DH parameter file to use for DHE key agreement. Use
`openssl dhparam` command to create it. If the file is invalid to
load, it is silently discarded. Its key length should be greater
than or eq... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
a3032d71-7f14-5f92-b85f-bfcf2a2e62ed | docs | nodejs | nodejs_tls | 012x | 10 | client, and the client chooses the cipher. Support for SSLv2 is disabled
unless node.js was configured with `./configure --with-sslv2`.
* `requestCert`: If `true` the server will request a certificate from
clients that connect and attempt to verify that certificate. Default:
`false`.
* `rejectUnauthorized`: If ... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
6c531627-e1cf-54e7-80d3-6c82f06a8610 | docs | nodejs | nodejs_tls | 012x | 11 | and `cb`. `SNICallback` should invoke `cb(null, ctx)`, where `ctx` is a
SecureContext instance.
(You can use `tls.createSecureContext(...)` to get proper
SecureContext). If `SNICallback` wasn't provided - default callback with
high-level API will be used (see below).
* `sessionTimeout`: An integer specifying ... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
96b0dbdc-79c9-5276-bf61-502de882d65c | docs | nodejs | nodejs_tls | 012x | 12 | * `secureProtocol`: 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](http://www.openssl.org/docs/ssl/ssl.html#DEALING_WITH_PROTOCOL_METHODS).
* `secureOptions`: Set server options. For example... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
30d58e8f-dd31-5b69-94e9-02ff1a1537c6 | docs | nodejs | nodejs_tls | 012x | 13 | socket.authorized ? 'authorized' : 'unauthorized');
socket.write("welcome!\n");
socket.setEncoding('utf8');
socket.pipe(socket);
});
server.listen(8000, function() {
console.log('server bound');
});
```
Or
```None
var tls = require('tls');
var fs = require('fs');
var options = {
pfx: fs.readF... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
6367ec28-035c-5fbc-9d91-ec561ea9e0fa | docs | nodejs | nodejs_tls | 012x | 14 | ## tls.connect(options[, callback])[#](#tls_tls_connect_options_callback)
## tls.connect(port[, host][, options][, callback])[#](#tls_tls_connect_port_host_options_callback)
Creates a new client connection to the given `port` and `host` (old API) or
`options.port` and `options.host`. (If `host` is omitted, it default... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
41375c6f-0a0a-55a9-87aa-6946ab143b9b | docs | nodejs | nodejs_tls | 012x | 15 | Consult the [OpenSSL cipher list format documentation](http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT) for details
on the format.
The full list of available ciphers can be obtained via [tls.getCiphers](#tls_tls_getciphers).
`ECDHE-RSA-AES128-SHA256`, `DHE-RSA-AES128-SHA256` and
`AES128-GCM... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
49a27d2d-cc8a-5316-8975-a85a6b5c63e9 | docs | nodejs | nodejs_tls | 012x | 16 | format. If this is omitted several well known "root" CAs will be used,
like VeriSign. These are used to authorize connections.
* `rejectUnauthorized`: If `true`, the server certificate is verified against
the list of supplied CAs. An `'error'` event is emitted if verification
fails; `err.code` contains the Open... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
60455d90-8740-52fe-bd92-e3c22191c585 | docs | nodejs | nodejs_tls | 012x | 17 | * `session`: A `Buffer` instance, containing TLS session.
The `callback` parameter will be added as a listener for the
['secureConnect'](#tls_event_secureconnect) event.
`tls.connect()` returns a [tls.TLSSocket](#tls_class_tls_tlssocket) object.
Here is an example of a client of echo server as described previously:
... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
1a868053-7b83-5e8c-b349-2044537918b4 | docs | nodejs | nodejs_tls | 012x | 18 | server.close();
});
```
Or
```None
var tls = require('tls');
var fs = require('fs');
var options = {
pfx: fs.readFileSync('client.pfx')
};
var socket = tls.connect(8000, options, function() {
console.log('client connected',
socket.authorized ? 'authorized' : 'unauthorized');
process.stdin.pipe... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
dba64f0d-fb9b-52b7-83d9-41b6bde28371 | docs | nodejs | nodejs_tls | 012x | 19 | * `secureContext`: An optional TLS context object from
`tls.createSecureContext( ... )`
* `isServer`: If true - TLS socket will be instantiated in server-mode
* `server`: An optional [net.Server](net.html#net_class_net_server) instance
* `requestCert`: Optional, see [tls.createSecurePair](#tls_tls_createsecurepair_cr... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
457a13ad-44a7-5462-97fa-abaf5eac88a9 | docs | nodejs | nodejs_tls | 012x | 20 | ## tls.createSecureContext(details)[#](#tls_tls_createsecurecontext_details)
Creates a credentials object, with the optional details being a
dictionary with keys:
* `pfx` : A string or buffer holding the PFX or PKCS12 encoded private
key, certificate and CA certificates
* `key` : A string holding the PEM encoded pr... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
9633435d-33f8-5dca-99b1-17903eea63e7 | docs | nodejs | nodejs_tls | 012x | 21 | If no 'ca' details are given, then node.js will use the default
publicly trusted list of CAs as given in
<http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt>.
## tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized])[#](#tls_tls_createsecurepair_context_isserve... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
e00cbaaa-595f-5a5a-abc4-d4d642689d8f | docs | nodejs | nodejs_tls | 012x | 22 | * `rejectUnauthorized`: A boolean indicating whether a server should
automatically reject clients with invalid certificates. Only applies to
servers with `requestCert` enabled.
`tls.createSecurePair()` returns a SecurePair object with `cleartext` and
`encrypted` stream properties.
NOTE: `cleartext` has the same A... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
63b68db6-47e3-54cd-a9b7-68e7431d52c2 | docs | nodejs | nodejs_tls | 012x | 23 | ### Event: 'secureConnection'[#](#tls_event_secureconnection)
`function (tlsSocket) {}`
This event is emitted after a new connection has been successfully
handshaked. The argument is an instance of [tls.TLSSocket](#tls_class_tls_tlssocket). It has all the
common stream methods and events.
`socket.authorized` is a bo... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
eba496e2-e152-5cf8-a93b-c9bc89a4d356 | docs | nodejs | nodejs_tls | 012x | 24 | ### Event: 'clientError'[#](#tls_event_clienterror)
`function (exception, tlsSocket) { }`
When a client connection emits an 'error' event before secure connection is
established - it will be forwarded here.
`tlsSocket` is the [tls.TLSSocket](#tls_class_tls_tlssocket) that the error originated from.
### Event: 'newS... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
e141b863-306b-50c1-a14f-15bccbbd8a9f | docs | nodejs | nodejs_tls | 012x | 25 | `callback(null, sessionData)` once finished. If session can't be resumed
(i.e. doesn't exist in storage) one may call `callback(null, null)`. Calling
`callback(err)` will terminate incoming connection and destroy socket.
NOTE: adding this event listener will have an effect only on connections
established after additio... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
fb6c5a3d-6c3e-5e8d-bd78-7de60adb0cce | docs | nodejs | nodejs_tls | 012x | 26 | Calling `callback(err)` will result in a `socket.destroy(err)` call.
Typical flow:
1. Client connects to server and sends `OCSPRequest` to it (via status info
extension in ClientHello.)
2. Server receives request and invokes `OCSPRequest` event listener if present
3. Server grabs OCSP url from either `certificate`... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
5cae72e3-1759-5264-9ff6-2ffab230364f | docs | nodejs | nodejs_tls | 012x | 27 | ### server.listen(port[, host][, callback])[#](#tls_server_listen_port_host_callback)
Begin accepting connections on the specified `port` and `host`. If the
`host` is omitted, the server will accept connections directed to any
IPv4 address (`INADDR_ANY`).
This function is asynchronous. The last parameter `callback` w... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
4364114d-3fb8-528c-afa6-8b9f0759034f | docs | nodejs | nodejs_tls | 012x | 28 | ### server.addContext(hostname, context)[#](#tls_server_addcontext_hostname_context)
Add secure context that will be used if client request's SNI hostname is
matching passed `hostname` (wildcards can be used). `context` can contain
`key`, `cert`, `ca` and/or any other properties from `tls.createSecureContext`
`options... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
c51a0402-57db-59aa-b36f-b3fd657d951e | docs | nodejs | nodejs_tls | 012x | 29 | ## Class: CleartextStream[#](#tls_class_cleartextstream)
The CleartextStream class in Node.js version v0.10.x (and prior) has been
deprecated and removed.
## Class: tls.TLSSocket[#](#tls_class_tls_tlssocket_1)
This is a wrapped version of [net.Socket](net.html#net_class_net_socket) that does transparent encryption
o... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
2246e28a-6218-5cd6-9c28-f1f4c09a04c7 | docs | nodejs | nodejs_tls | 012x | 30 | `tlsSocket.npnProtocol` for negotiated protocol.
### Event: 'OCSPResponse'[#](#tls_event_ocspresponse)
`function (response) { }`
This event will be emitted if `requestOCSP` option was set. `response` is a
buffer object, containing server's OCSP response.
Traditionally, the `response` is a signed object from the ser... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
f6233c8c-0f08-529f-ae90-0036e4f77f66 | docs | nodejs | nodejs_tls | 012x | 31 | ### tlsSocket.getPeerCertificate([ detailed ])[#](#tls_tlssocket_getpeercertificate_detailed)
Returns an object representing the peer's certificate. The returned object has
some properties corresponding to the field of the certificate. If `detailed`
argument is `true` - the full chain with `issuer` property will be re... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
49906b10-698f-51bc-a010-ccddbd79f909 | docs | nodejs | nodejs_tls | 012x | 32 | If the peer does not provide a certificate, it returns `null` or an empty
object.
### tlsSocket.getCipher()[#](#tls_tlssocket_getcipher)
Returns an object representing the cipher name and the SSL/TLS
protocol version of the current connection.
Example:
{ name: 'AES256-SHA', version: 'TLSv1/SSLv3' }
See SSL\_CIPHER\... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
d03d8306-149c-5a72-a4f2-52b9e5339d9c | docs | nodejs | nodejs_tls | 012x | 33 | ANOTHER NOTE: When running as the server, socket will be destroyed
with an error after `handshakeTimeout` timeout.
### tlsSocket.setMaxSendFragment(size)[#](#tls_tlssocket_setmaxsendfragment_size)
Set maximum TLS fragment size (default and maximum value is: `16384`, minimum
is: `512`). Returns `true` on success, `fal... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
9b14a599-3f92-537d-836d-d14b4e18d6c6 | docs | nodejs | nodejs_tls | 012x | 34 | ### tlsSocket.getTLSTicket()[#](#tls_tlssocket_gettlsticket)
NOTE: Works only with client TLS sockets. Useful only for debugging, for
session reuse provide `session` option to `tls.connect`.
Return TLS session ticket or `undefined` if none was negotiated.
### tlsSocket.address()[#](#tls_tlssocket_address)
Returns t... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
d7151279-b6a0-5883-a994-e52245946142 | docs | nodejs | nodejs_tls | 012x | 35 | ### tlsSocket.remotePort[#](#tls_tlssocket_remoteport)
The numeric representation of the remote port. For example, `443`.
### tlsSocket.localAddress[#](#tls_tlssocket_localaddress)
The string representation of the local IP address.
### tlsSocket.localPort[#](#tls_tlssocket_localport)
The numeric representation of ... | large_dataset/raw/docs/nodejs/tls/tls_012x.md |
98ca2fd6-2a6f-5f23-bc07-7bbc916c9261 | docs | nodejs | nodejs_tls | 10x | 0 | # TLS (SSL)#
Source: https://nodejs.org/docs/latest-v10.x/api/tls.html
Version: 10.x
[Stability: 2](documentation.html#documentation_stability_index) - Stable
The `tls` module provides an implementation of the Transport Layer Security
(TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL.
The... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
1f6be2c0-3950-5c5e-bf56-0cd6d78b1394 | docs | nodejs | nodejs_tls | 10x | 1 | private key (such certificates are referred to as "self-signed"). The first
step to obtaining a certificate is to create a *Certificate Signing Request*
(CSR) file.
The OpenSSL command-line interface can be used to generate a CSR for a private
key:
```None
openssl req -new -sha256 -key ryans-key.pem -out ryans-csr.pe... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
614c1edc-0854-54dd-9f21-117fcf15fe54 | docs | nodejs | nodejs_tls | 10x | 2 | * `certfile`: is a concatenation of all Certificate Authority (CA) certs into
a single file, e.g. `cat ca1-cert.pem ca2-cert.pem > ca-cert.pem`
### Perfect Forward Secrecy[#](#tls_perfect_forward_secrecy)
The term "[Forward Secrecy](https://en.wikipedia.org/wiki/Perfect_forward_secrecy)" or "Perfect Forward Secrecy... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
31564f3b-291e-5db0-be95-9ceba1bd708a | docs | nodejs | nodejs_tls | 10x | 3 | Currently two methods are commonly used to achieve Perfect Forward Secrecy (note
the character "E" appended to the traditional abbreviations):
* [DHE](https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange) - An ephemeral version of the Diffie Hellman key-agreement protocol.
* [ECDHE](https://en.wikipedia.o... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
608a03d9-ce2c-563b-b6ab-c89f4c2a11ae | docs | nodejs | nodejs_tls | 10x | 4 | not required and a default ECDHE curve will be used. The `ecdhCurve` property
can be used when creating a TLS Server to specify the list of names of supported
curves to use, see [`tls.createServer()`](#tls_tls_createserver_options_secureconnectionlistener) for more info.
### ALPN and SNI[#](#tls_alpn_and_sni)
ALPN (A... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
c23c13ef-0eda-52c4-b35b-bdaa17b5683c | docs | nodejs | nodejs_tls | 10x | 5 | To mitigate the risk, renegotiation is limited to three times every ten minutes.
An `'error'` event is emitted on the [`tls.TLSSocket`](#tls_class_tls_tlssocket) instance when this
threshold is exceeded. The limits are configurable:
* `tls.CLIENT_RENEG_LIMIT` [<number>](https://developer.mozilla.org/en-US/docs/Web/Jav... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
678d0913-96d9-5987-bc99-1c313eb44e0d | docs | nodejs | nodejs_tls | 10x | 6 | ***Session Identifiers*** Servers generate a unique ID for new connections and
send it to the client. Clients and servers save the session state. When
reconnecting, clients send the ID of their saved session state and if the server
also has the state for that ID, it can agree to use it. Otherwise, the server
will creat... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
ffed30f0-9092-56dc-bb71-dc13045f2fa3 | docs | nodejs | nodejs_tls | 10x | 7 | to save and restore the session data using the session ID as the lookup key to
reuse sessions. To reuse sessions across load balancers or cluster workers,
servers must use a shared session cache (such as Redis) in their session
handlers.
***Session Tickets*** The servers encrypt the entire session state and send it
to... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
8f89ca57-5c08-5b95-a2d8-15761a5e8720 | docs | nodejs | nodejs_tls | 10x | 8 | [`tls.TLSSocket.getTLSTicket()`](#tls_tlssocket_gettlsticket) returns a value, the session data contains a
ticket, otherwise it contains client-side session state.
Single process servers need no specific implementation to use session tickets.
To use session tickets across server restarts or load balancers, servers mus... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
e0fc78f5-e57b-5a4d-8862-e0cef69e5ecb | docs | nodejs | nodejs_tls | 10x | 9 | Session ticket keys are cryptographic keys, and they ***must be stored
securely***. With TLS 1.2 and below, if they are compromised all sessions that
used tickets encrypted with them can be decrypted. They should not be stored
on disk, and they should be regenerated regularly.
If clients advertise support for tickets,... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
033ee763-0254-5fda-a4c7-950dd93e3e4e | docs | nodejs | nodejs_tls | 10x | 10 | `-reconnect` option to `openssl s_client`, for example:
```None
$ openssl s_client -connect localhost:443 -reconnect
```
Read through the debug output. The first connection should say "New", for
example:
```None
New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256
```
Subsequent connections should say "Reused", for ... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
a9c6a2f8-0d3d-5d1a-bde2-4b6c88b7849b | docs | nodejs | nodejs_tls | 10x | 11 | This default can be replaced entirely using the [`--tls-cipher-list`](cli.html#cli_tls_cipher_list_list) command
line switch (directly, or via the [`NODE_OPTIONS`](cli.html#cli_node_options_options) environment variable). For
instance, the following makes `ECDHE-RSA-AES128-GCM-SHA256:!RC4` the default TLS
cipher suite:... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
32f54e65-fbf4-5d8c-bf25-1da53c41b85c | docs | nodejs | nodejs_tls | 10x | 12 | Consult [OpenSSL cipher list format documentation](https://www.openssl.org/docs/man1.1.0/apps/ciphers.html#CIPHER-LIST-FORMAT) for details on the format.
The default cipher suite included within Node.js has been carefully
selected to reflect current security best practices and risk mitigation.
Changing the default cip... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
5d85aa89-491a-51ba-be40-d03a312f5635 | docs | nodejs | nodejs_tls | 10x | 13 | Old clients that rely on insecure and deprecated RC4 or DES-based ciphers
(like Internet Explorer 6) cannot complete the handshaking process with
the default configuration. If these clients *must* be supported, the
[TLS recommendations](https://wiki.mozilla.org/Security/Server_Side_TLS) may offer a compatible cipher su... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
bfc1481c-531b-5f8e-815a-8fa4eebc90f0 | docs | nodejs | nodejs_tls | 10x | 14 | The `keylog` event is emitted when key material is generated or received by
a connection to this server (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.
... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
92b911ed-29c9-5c31-9204-309f797bc031 | docs | nodejs | nodejs_tls | 10x | 15 | The listener callback is passed three arguments when called:
* `sessionId` [<Buffer>](buffer.html#buffer_class_buffer) The TLS session identifier
* `sessionData` [<Buffer>](buffer.html#buffer_class_buffer) The TLS session data
* `callback` [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
1eb3cc07-779b-5da0-b16c-10b0af23acb9 | docs | nodejs | nodejs_tls | 10x | 16 | * `callback` [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) A callback function that must be invoked to provide
the results of the OCSP request.
The server's current certificate can be parsed to obtain the OCSP URL
and certificate ID; after obtaining an OCSP r... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
794a1703-35a8-5c9c-984d-2b8e2acb40b7 | docs | nodejs | nodejs_tls | 10x | 17 | 2. Server receives the request and emits the `'OCSPRequest'` event, calling the
listener if registered.
3. Server extracts the OCSP URL from either the `certificate` or `issuer` and
performs an [OCSP request](https://en.wikipedia.org/wiki/OCSP_stapling) to the CA.
4. Server receives `'OCSPResponse'` from the CA a... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
91974887-7929-5c0a-864a-0e90e9d88b6b | docs | nodejs | nodejs_tls | 10x | 18 | ### Event: 'resumeSession'[#](#tls_event_resumesession)
Added in: v0.9.2
The `'resumeSession'` event is emitted when the client requests to resume a
previous TLS session. The listener callback is passed two arguments when
called:
* `sessionId` [<Buffer>](buffer.html#buffer_class_buffer) The TLS session identifier
* ... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
a3f1acb1-7b54-55be-8b1a-92a539a64fdc | docs | nodejs | nodejs_tls | 10x | 19 | If not found, the session cannot be resumed. `callback()` must be called
without `sessionData` so that the handshake can continue and a new session can
be created. It is possible to call `callback(err)` to terminate the incoming
connection and destroy the socket.
Listening for this event will have an effect only on co... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
5150dbb5-a563-5784-b050-d44d240811b8 | docs | nodejs | nodejs_tls | 10x | 20 | * `tlsSocket` [<tls.TLSSocket>](tls.html#tls_class_tls_tlssocket) The established TLS socket.
The `tlsSocket.authorized` property is a `boolean` indicating whether the
client has been verified by one of the supplied Certificate Authorities for the
server. If `tlsSocket.authorized` is `false`, then `socket.authorizatio... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
bc820d8a-e741-5847-a3f5-95e502f9f27b | docs | nodejs | nodejs_tls | 10x | 21 | * `exception` [<Error>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) The `Error` object describing the error
* `tlsSocket` [<tls.TLSSocket>](tls.html#tls_class_tls_tlssocket) The `tls.TLSSocket` instance from which the
error originated.
### server.addContext(hostname, conte... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
07bfe6a3-6e4f-579b-ba71-a1bcac8965c4 | docs | nodejs | nodejs_tls | 10x | 22 | ### server.address()[[src]](https://github.com/nodejs/node/blob/5182a7ece0b71feeb9157f7aa348a15d53e32058/lib/net.js#L1475)[#](#tls_server_address)
Added in: v0.6.0
* Returns: [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
Returns the bound address, the address fam... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
409cf355-3c07-5459-bd9a-430fa9ffe890 | docs | nodejs | nodejs_tls | 10x | 23 | This function operates asynchronously. The `'close'` event will be emitted
when the server has no more open connections.
### server.connections[#](#tls_server_connections)
Added in: v0.3.2Deprecated since: v0.9.7
[Stability: 0](documentation.html#documentation_stability_index) - Deprecated: Use [`server.getConnectio... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
5c1067c2-467b-5f3d-ba54-7d4791637e97 | docs | nodejs | nodejs_tls | 10x | 24 | ### server.listen()[[src]](https://github.com/nodejs/node/blob/5182a7ece0b71feeb9157f7aa348a15d53e32058/lib/net.js#L1360)[#](#tls_server_listen)
Starts the server listening for encrypted connections.
This method is identical to [`server.listen()`](net.html#net_server_listen) from [`net.Server`](net.html#net_class_net_... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
12a55c0e-2ca4-5d9f-b171-a5b70be95c5d | docs | nodejs | nodejs_tls | 10x | 25 | Instances of `tls.TLSSocket` implement the duplex [Stream](stream.html#stream_stream) interface.
Methods that return TLS connection metadata (e.g.
[`tls.TLSSocket.getPeerCertificate()`](#tls_tlssocket_getpeercertificate_detailed) will only return data while the
connection is open.
### new tls.TLSSocket(socket[, optio... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
3d34e75a-1ce8-5f37-ac51-f352e4ae43b5 | docs | nodejs | nodejs_tls | 10x | 26 | + `isServer`: The SSL/TLS protocol is asymmetrical, TLSSockets must know if
they are to behave as a server or a client. If `true` the TLS socket will be
instantiated as a server. **Default:** `false`.
+ `server` [<net.Server>](net.html#net_class_net_server) A [`net.Server`](net.html#net_class_net_server) in... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
e34ca5a3-161a-5b6c-820b-8ee9a8298b84 | docs | nodejs | nodejs_tls | 10x | 27 | + `requestOCSP` [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) If `true`, specifies that the OCSP status request
extension will be added to the client hello and an `'OCSPResponse'` event
will be emitted on the socket before establishing a secure communication... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
9676a93f-def6-52d5-85eb-91b96b8a5e5d | docs | nodejs | nodejs_tls | 10x | 28 | ### Event: 'keylog'[#](#tls_event_keylog_1)
Added in: v10.20.0
* `line` [<Buffer>](buffer.html#buffer_class_buffer) Line of ASCII text, in NSS `SSLKEYLOGFILE` format.
The `keylog` event is emitted on a client `tls.TLSSocket` when key material
is generated or received by the socket. This keying material can be stored... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
2ff2f119-808d-58a0-829a-b64e55fd1a30 | docs | nodejs | nodejs_tls | 10x | 29 | The listener callback is passed a single argument when called:
* `response` [<Buffer>](buffer.html#buffer_class_buffer) The server's OCSP response
Typically, the `response` is a digitally signed object from the server's CA that
contains information about server's certificate revocation status.
### Event: 'secureConn... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
360c5a68-887b-5c6c-b8ea-ca63d634cc8e | docs | nodejs | nodejs_tls | 10x | 30 | ### tlsSocket.address()[#](#tls_tlssocket_address)
Added in: v0.11.4
* Returns: [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
Returns the bound `address`, the address `family` name, and `port` of the
underlying socket as reported by the operating system:
`{ port:... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
46993c49-03c7-5303-832d-31c4c8cb36f8 | docs | nodejs | nodejs_tls | 10x | 31 | ### tlsSocket.disableRenegotiation()[#](#tls_tlssocket_disablerenegotiation)
Added in: v8.4.0
Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts
to renegotiate will trigger an `'error'` event on the `TLSSocket`.
### tlsSocket.encrypted[#](#tls_tlssocket_encrypted)
Added in: v0.11.4
Alw... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
7aaf67a5-fa96-51b4-99e3-5050bacab70d | docs | nodejs | nodejs_tls | 10x | 32 | ### tlsSocket.getEphemeralKeyInfo()[#](#tls_tlssocket_getephemeralkeyinfo)
Added in: v5.0.0
* Returns: [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
Returns an object representing the type, name, and size of parameter of
an ephemeral key exchange in [Perfect Forw... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
160a50a2-911d-5ce1-ba33-b203f53624aa | docs | nodejs | nodejs_tls | 10x | 33 | sent to the socket as part of a SSL/TLS handshake, or `undefined` if
no `Finished` message has been sent yet.
As the `Finished` messages are message digests of the complete handshake
(with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can
be used for external authentication procedures when the authen... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
afb95934-87c3-5149-ad57-37658512c14a | docs | nodejs | nodejs_tls | 10x | 34 | Returns an object representing the peer's certificate. The returned object has
some properties corresponding to the fields of the certificate.
If the full certificate chain was requested, each certificate will include an
`issuerCertificate` property containing an object representing its issuer's
certificate.
```None
... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
a0acd37c-02a2-5a42-b102-fc0826c6132b | docs | nodejs | nodejs_tls | 10x | 35 | fingerprint256: '2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:5A:71:38:52:EC:8A:DF:00:11:22:33:44:55:66:77:88:99:AA:BB',
serialNumber: 'B9B0D332A1AA5635' }
```
If the peer does not provide a certificate, an empty object will be returned.
### tlsSocket.getPeerFinished()[#](#tls_tlssocket_getpeerfinished)
Added in: v9.9... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
44eb3b16-7a57-5723-a4c5-2916ce089ae8 | docs | nodejs | nodejs_tls | 10x | 36 | to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929).
### tlsSocket.getProtocol()[#](#tls_tlssocket_getprotocol)
Added in: v5.7.0
* Returns: [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | [<null>](https://developer.mozil... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
0273e58b-3cad-5dbe-bd64-bad232e541af | docs | nodejs | nodejs_tls | 10x | 37 | ### tlsSocket.getSession()[#](#tls_tlssocket_getsession)
Added in: v0.11.4
* [<Buffer>](buffer.html#buffer_class_buffer)
Returns the TLS session data or `undefined` if no session was
negotiated. On the client, the data can be provided to the `session` option of
[`tls.connect()`](#tls_tls_connect_options_callback) to... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
debb6ca0-08d6-5817-a5e4-d2b9f016cd3d | docs | nodejs | nodejs_tls | 10x | 38 | ### tlsSocket.isSessionReused()[#](#tls_tlssocket_issessionreused)
Added in: v0.5.6
* Returns: [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) `true` if the session was reused, `false` otherwise.
See [Session Resumption](#tls_session_resumption) for more information.... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
05f59c19-52b6-51a3-96e8-366091ce35c7 | docs | nodejs | nodejs_tls | 10x | 39 | Returns the string representation of the remote IP address. For example,
`'74.125.127.100'` or `'2001:4860:a005::68'`.
### tlsSocket.remoteFamily[#](#tls_tlssocket_remotefamily)
Added in: v0.11.4
* [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)
Returns the string rep... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
36e3ecaa-fcf0-5037-bd51-7419eadaced8 | docs | nodejs | nodejs_tls | 10x | 40 | verified against the list of supplied CAs. An `'error'` event is emitted if
verification fails; `err.code` contains the OpenSSL error code. **Default:**
`true`.
+ `requestCert`
* `callback` [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) A function t... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
b365cdfa-d954-597e-b8c9-c935ab877fb6 | docs | nodejs | nodejs_tls | 10x | 41 | ### tlsSocket.setMaxSendFragment(size)[#](#tls_tlssocket_setmaxsendfragment_size)
Added in: v0.11.11
* `size` [<number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) The maximum TLS fragment size. The maximum value is `16384`.
**Default:** `16384`.
* Returns: [<boolean>](http... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
c501bf12-8f02-57ae-80a6-d049248d8445 | docs | nodejs | nodejs_tls | 10x | 42 | ## tls.checkServerIdentity(hostname, cert)[[src]](https://github.com/nodejs/node/blob/5182a7ece0b71feeb9157f7aa348a15d53e32058/lib/tls.js#L192)[#](#tls_tls_checkserveridentity_hostname_cert)
Added in: v0.8.4
* `hostname` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) T... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
0f5907b4-390b-5473-a0e3-9671866ba8d9 | docs | nodejs | nodejs_tls | 10x | 43 | Returns [<Error>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on
failure. On success, returns [<undefined>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type).
This function can be o... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
333ebf90-cdd5-53cb-ada3-4d9a5f0b7b1b | docs | nodejs | nodejs_tls | 10x | 44 | CN: 'COMODO RSA Domain Validation Secure Server CA' },
subjectaltname: 'DNS:*.nodejs.org, DNS:nodejs.org',
infoAccess:
{ 'CA Issuers - URI':
[ 'http://crt.comodoca.com/COMODORSADomainValidationSecureServerCA.crt' ],
'OCSP - URI': [ 'http://ocsp.comodoca.com' ] }, | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
6b6a2c7e-af4e-5448-856d-1eba70926826 | docs | nodejs | nodejs_tls | 10x | 45 | modulus: 'B56CE45CB740B09A13F64AC543B712FF9EE8E4C284B542A1708A27E82A8D151CA178153E12E6DDA15BF70FFD96CB8A88618641BDFCCA03527E665B70D779C8A349A6F88FD4EF6557180BD4C98192872BCFE3AF56E863C09DDD8BC1EC58DF9D94F914F0369102B2870BECFA1348A0838C9C49BD1C20124B442477572347047506B1FCD658A80D0C44BCC16BC5C5496CFE6E4A8428EF654CD3D897... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
d0ac54df-46d1-5465-88b7-ec52ef0fac55 | docs | nodejs | nodejs_tls | 10x | 46 | exponent: '0x10001',
pubkey: <Buffer ... >,
valid_from: 'Aug 14 00:00:00 2017 GMT',
valid_to: 'Nov 20 23:59:59 2019 GMT',
fingerprint: '01:02:59:D9:C3:D2:0D:08:F7:82:4E:44:A4:B4:53:C5:E2:3A:87:4D',
fingerprint256: '69:AE:1A:6A:D4:3D:C6:C1:1B:EA:C6:23:DE:BA:2A:14:62:62:93:5C:7A:EA:06:41:9B:0B:BC:87:CE:48:4E:... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
e2460ba4-941f-53c7-b3b1-5052edbcfbc3 | docs | nodejs | nodejs_tls | 10x | 47 | + `host` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) Host the client should connect to. **Default:**
`'localhost'`.
+ `port` [<number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) Port the client should connect to.
+ ... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
166ae854-23fe-519d-aa78-77b3068fc9ef | docs | nodejs | nodejs_tls | 10x | 48 | when passed to `tls.connect()`, but it can be connected later. Note that
connection/disconnection/destruction of `socket` is the user's
responsibility, calling `tls.connect()` will not cause `net.connect()` to be
called.
+ `rejectUnauthorized` [<boolean>](https://developer.mozilla.org/en-US/docs/Web/J... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
75c37a3a-c6da-51fe-b11f-8536e66e316d | docs | nodejs | nodejs_tls | 10x | 49 | An array of strings, `Buffer`s or `Uint8Array`s, or a single `Buffer` or
`Uint8Array` containing the supported ALPN protocols. `Buffer`s should have
the format `[len][name][len][name]...` e.g. `'\x08http/1.1\x08http/1.0'`,
where the `len` byte is the length of the next protocol name. Passing an
arra... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
f1fd6460-416d-57bc-8b31-81065ef46a16 | docs | nodejs | nodejs_tls | 10x | 50 | + `checkServerIdentity(servername, cert)` [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) A callback function
to be used (instead of the builtin `tls.checkServerIdentity()` function)
when checking the server's hostname (or the provided `servername` when
... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
61775d8e-5f5d-5c47-8f34-90a3bda01c5d | docs | nodejs | nodejs_tls | 10x | 51 | **Default:** `1024`.
+ `secureContext`: TLS context object created with
[`tls.createSecureContext()`](#tls_tls_createsecurecontext_options). If a `secureContext` is *not* provided, one
will be created by passing the entire `options` object to
`tls.createSecureContext()`.
+ `lookup`: [<Function>](htt... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
be74ef8e-0630-5a8a-bb46-46f6e6742cfb | docs | nodejs | nodejs_tls | 10x | 52 | * `callback` [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)
* Returns: [<tls.TLSSocket>](tls.html#tls_class_tls_tlssocket)
The `callback` function, if specified, will be added as a listener for the
[`'secureConnect'`](#tls_event_secureconnect) event.
`tls.conne... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
59858a14-133b-5cd7-9d77-9868ea687b2c | docs | nodejs | nodejs_tls | 10x | 53 | checkServerIdentity: () => { return null; },
};
const socket = tls.connect(8000, options, () => {
console.log('client connected',
socket.authorized ? 'authorized' : 'unauthorized');
process.stdin.pipe(socket);
process.stdin.resume();
});
socket.setEncoding('utf8');
socket.on('data', (data) => {
... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
aee2ec25-38d1-5af5-83c1-1d3b1bf89877 | docs | nodejs | nodejs_tls | 10x | 54 | * Returns: [<tls.TLSSocket>](tls.html#tls_class_tls_tlssocket)
Same as [`tls.connect()`](#tls_tls_connect_options_callback) except that `path` can be provided
as an argument instead of an option.
A path option, if specified, will take precedence over the path argument.
## tls.connect(port[, host][, options][, callba... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
d00aee61-db4d-5ba1-ace9-d636077c79c2 | docs | nodejs | nodejs_tls | 10x | 55 | * Returns: [<tls.TLSSocket>](tls.html#tls_class_tls_tlssocket)
Same as [`tls.connect()`](#tls_tls_connect_options_callback) except that `port` and `host` can be provided
as arguments instead of options.
A port or host option, if specified, will take precedence over any port or host
argument.
## tls.createSecureConte... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
e87e40de-3470-5b6e-8f98-f62f79ce10d5 | docs | nodejs | nodejs_tls | 10x | 56 | | v5.2.0 | The `ca` option can now be a single string containing multiple CA certificates. |
| v0.11.13 | Added in: v0.11.13 |
* `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
+ `ca` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Dat... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
ca1e1c28-87af-5cca-835d-992056d27fea | docs | nodejs | nodejs_tls | 10x | 57 | trusted by the server for the connection to be authenticated. When using
certificates that are not chainable to a well-known CA, the certificate's CA
must be explicitly specified as a trusted or the connection will fail to
authenticate.
If the peer uses a certificate that doesn't match or chain to o... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
ee908849-6ae5-5836-a300-7a945ecd2f77 | docs | nodejs | nodejs_tls | 10x | 58 | chain should be provided per private key. Each cert chain should consist of
the PEM formatted certificate for a provided private `key`, followed by the
PEM formatted intermediate certificates (if any), in order, and not
including the root CA (the root CA must be pre-known to the peer, see `ca`).
Whe... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
0a2fd937-389d-54e7-ab04-8941660c677d | docs | nodejs | nodejs_tls | 10x | 59 | client certificate.
+ `crl` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | [<string[]>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | [<Buffer>](buffer.html#buffer_class_buffer) | [<Buffer[]>](buffer.html#buffer_class_buff... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
768ce27f-d8e1-5d16-947e-08cb522abab6 | docs | nodejs | nodejs_tls | 10x | 60 | + `ecdhCurve` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) A string describing a named curve or a colon separated
list of curve NIDs or names, for example `P-521:P-384:P-256`, to use for
ECDH key agreement. Set to `auto` to select the
curve automatically.... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
26ee8554-596c-5456-ad3f-18aa12105d4d | docs | nodejs | nodejs_tls | 10x | 61 | + `key` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | [<string[]>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | [<Buffer>](buffer.html#buffer_class_buffer) | [<Buffer[]>](buffer.html#buffer_class_buffer) | [<Object[]>](https... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
7e3b9e4a-2316-5737-8c1e-39b9080212a1 | docs | nodejs | nodejs_tls | 10x | 62 | + `maxVersion` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) Optionally set the maximum TLS version to allow. One
of `TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
`secureProtocol` option, use one or the other.
**Default:** [`tls... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
f4cf1036-43c3-5ed1-84ff-31b5aa0c809c | docs | nodejs | nodejs_tls | 10x | 63 | + `pfx` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | [<string[]>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | [<Buffer>](buffer.html#buffer_class_buffer) | [<Buffer[]>](buffer.html#buffer_class_buffer) | [<Object[]>](https... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
35055b58-840f-5ae5-bcfa-594b3c3fd325 | docs | nodejs | nodejs_tls | 10x | 64 | + `secureOptions` [<number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) Optionally affect the OpenSSL protocol behavior,
which is not usually necessary. This should be used carefully if at all!
Value is a numeric bitmask of the `SSL_OP_*` options from
[OpenSSL Opt... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
a894ca21-49e9-56a6-bc07-072cea8eb7ef | docs | nodejs | nodejs_tls | 10x | 65 | + `sessionIdContext` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) Opaque identifier used by servers to ensure
session state is not shared between applications. Unused by clients.
[`tls.createServer()`](#tls_tls_createserver_options_secureconnectionlistener) sets... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
0a7c8ae4-b9b0-5515-8328-8be9086c1b6c | docs | nodejs | nodejs_tls | 10x | 66 | <https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt>.
## tls.createServer([options][, secureconnectionlistener])[#](#tls_tls_createserver_options_secureconnectionlistener)
History
| Version | Changes |
| --- | --- |
| v9.3.0 | The `options` parameter can now include `clie... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
c48aafd1-72a9-5ee8-a235-732cd69420a6 | docs | nodejs | nodejs_tls | 10x | 67 | + `ALPNProtocols`: [<string[]>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | [<Buffer[]>](buffer.html#buffer_class_buffer) | [<Uint8Array[]>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) | [<Buffer>](buffer.html#buffer_class_buf... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
daca6f7d-0542-5c35-ba63-3140460e18ad | docs | nodejs | nodejs_tls | 10x | 68 | client certificate.
+ `handshakeTimeout` [<number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) Abort the connection if the SSL/TLS handshake
does not finish in the specified number of milliseconds.
A `'tlsClientError'` is emitted on the `tls.Server` object wheneve... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
2a8c4c13-71bb-5924-a4cf-d2af4046ed64 | docs | nodejs | nodejs_tls | 10x | 69 | + `sessionTimeout` [<number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) The number of seconds after which a TLS session
created by the server will no longer be resumable. See
[Session Resumption](#tls_session_resumption) for more information. **Default:** `300`.
+ ... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
c417f46c-74b5-57ac-b0b2-5e61d8e3c93f | docs | nodejs | nodejs_tls | 10x | 70 | data. See [Session Resumption](#tls_session_resumption) for more information.
+ ...: Any [`tls.createSecureContext()`](#tls_tls_createsecurecontext_options) option can be provided. For
servers, the identity options (`pfx` or `key`/`cert`) are usually required.
* `secureConnectionListener` [<Function>](https:/... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
348266e0-d0b7-5c89-8700-be7572a73d62 | docs | nodejs | nodejs_tls | 10x | 71 | // This is necessary only if using client certificate authentication.
requestCert: true,
// This is necessary only if the client uses a self-signed certificate.
ca: [ fs.readFileSync('client-cert.pem') ]
};
const server = tls.createServer(options, (socket) => {
console.log('server connected',
... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.