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 |
|---|---|---|---|---|---|---|---|
d06084a5-0e45-5793-809d-325927b15b13 | docs | nodejs | nodejs_tls | 6x | 28 | ### tlsSocket.getSession()[#](#tls_tlssocket_getsession)
Added in: v0.11.4
Returns the ASN.1 encoded TLS session or `undefined` if no session was
negotiated. Can be used to speed up handshake establishment when reconnecting
to the server.
### tlsSocket.getTLSTicket()[#](#tls_tlssocket_gettlsticket)
Added in: v0.11.... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
9339b870-13ee-5cb9-bcda-5b2be9c3f411 | docs | nodejs | nodejs_tls | 6x | 29 | ### tlsSocket.remoteAddress[#](#tls_tlssocket_remoteaddress)
Added in: v0.11.4
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
Returns the string representation of the... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
57128270-77b9-52d8-b9af-be6b50985c6e | docs | nodejs | nodejs_tls | 6x | 30 | * `callback` [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) A function that will be called when the renegotiation
request has been completed.
The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process.
Upon completion, the `callback` function w... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
b6df4a16-e5c2-5399-85ac-7dfddb456dfc | docs | nodejs | nodejs_tls | 6x | 31 | Returns `true` if setting the limit succeeded; `false` otherwise.
Smaller fragment sizes decrease the buffering latency on the client: larger
fragments are buffered by the TLS layer until the entire fragment is received
and its integrity is verified; large fragments can span multiple roundtrips
and their processing ca... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
c4871e54-e7c4-543d-a62f-ef56096080c1 | docs | nodejs | nodejs_tls | 6x | 32 | * `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) See [`tls.connect()`](#tls_tls_connect_options_callback).
* `callback` [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) See [`tls.connect()`](#tls_tls_co... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
85ca4e7d-e7e4-5101-b4c2-a931dd332ce2 | docs | nodejs | nodejs_tls | 6x | 33 | * `callback` [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) See [`tls.connect()`](#tls_tls_connect_options_callback).
Same as [`tls.connect()`](#tls_tls_connect_options_callback) except that `path` can be provided
as an argument instead of an option.
*Note*: A ... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
f677dc5d-b27a-537a-9a58-e58dc3f41eee | docs | nodejs | nodejs_tls | 6x | 34 | + `path` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) Creates unix socket connection to path. If this option is
specified, `host` and `port` are ignored.
+ `socket` [<stream.Duplex>](stream.html#stream_class_stream_duplex) Establish secure connection on a given... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
4c360c46-8538-5acc-b89f-61d29cf0e344 | docs | nodejs | nodejs_tls | 6x | 35 | + `rejectUnauthorized` [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) 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 OpenSSL error code. Defaults to
... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
109642d7-e7f1-5117-94ea-1ab957478286 | docs | nodejs | nodejs_tls | 6x | 36 | containing the supported ALPN protocols. `Buffer`s should have the format
`[len][name][len][name]...` e.g. `0x05hello0x05world`, where the first byte
is the length of the next protocol name. Passing an array is usually much
simpler: `['hello', 'world']`.)
+ `servername`: [<string>](https://developer.m... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
48360cbe-3663-576f-a2a0-7830468102f9 | docs | nodejs | nodejs_tls | 6x | 37 | + `session` [<Buffer>](buffer.html#buffer_class_buffer) A `Buffer` instance, containing TLS session.
+ `minDHSize` [<number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) Minimum size of the DH parameter in bits to accept a
TLS connection. When a server offers a DH parame... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
9450ef90-30e2-5657-abf3-f79f507cc642 | docs | nodejs | nodejs_tls | 6x | 38 | + `lookup`: [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) Custom lookup function. Defaults to [`dns.lookup()`](dns.html#dns_dns_lookup_hostname_options_callback).
+ ...: Optional [`tls.createSecureContext()`](#tls_tls_createsecurecontext_options) options can... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
cdd80d15-13d5-5eda-ba57-1f943e8b926a | docs | nodejs | nodejs_tls | 6x | 39 | // Necessary only if the server uses the self-signed certificate
ca: [ fs.readFileSync('server-cert.pem') ]
};
const socket = tls.connect(8000, options, () => {
console.log('client connected',
socket.authorized ? 'authorized' : 'unauthorized');
process.stdin.pipe(socket);
process.stdin.resume()... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
ec836e47-fcec-58db-9703-996e9d69bf1d | docs | nodejs | nodejs_tls | 6x | 40 | ## tls.createSecureContext(options)[#](#tls_tls_createsecurecontext_options)
Added in: v0.11.13
* `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
+ `pfx` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | [<... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
0755a297-fb4d-5ced-964c-7e692a3904ce | docs | nodejs | nodejs_tls | 6x | 41 | PEM format. PEM allows the option of private keys being encrypted. Encrypted
keys will be decrypted with `options.passphrase`. Multiple keys using
different algorithms can be provided either as an array of unencrypted key
strings or buffers, or an array of objects in the form `{pem:
<string|buffer>[... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
2c68d93b-bd80-523c-b5ba-f5a37c915de2 | docs | nodejs | nodejs_tls | 6x | 42 | + `cert` [<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) Optional cert chain... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
e0cbc7ec-7635-5c1d-9f0c-5d889e741662 | docs | nodejs | nodejs_tls | 6x | 43 | + `ca` [<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) Optionally override t... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
e8ded8f4-f5ae-57b0-af53-035c52cc295b | docs | nodejs | nodejs_tls | 6x | 44 | If the peer uses a certificate that doesn't match or chain to one of the
default CAs, use the `ca` option to provide a CA certificate that the peer's
certificate can match or chain to.
For self-signed certificates, the certificate is its own CA, and must be
provided.
+ `crl` [<string>](https://dev... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
11f2cf37-17a9-5691-8532-edf01a629da5 | docs | nodejs | nodejs_tls | 6x | 45 | + `honorCipherOrder` [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) Attempt to use the server's cipher suite
preferences instead of the client's. When `true`, causes
`SSL_OP_CIPHER_SERVER_PREFERENCE` to be set in `secureOptions`, see
[OpenSSL Options](cry... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
90c8799b-2526-59aa-84b5-719cd0232311 | docs | nodejs | nodejs_tls | 6x | 46 | will also display the name and description of each available elliptic curve.
+ `dhparam` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | [<Buffer>](buffer.html#buffer_class_buffer) Diffie Hellman parameters, required for
[Perfect Forward Secrecy](#tls_perfect_... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
ee51b69d-2e2b-5ac0-8823-a5beb3b2d462 | docs | nodejs | nodejs_tls | 6x | 47 | the function names as strings. For example, `'SSLv3_method'` to force SSL
version 3.
+ `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 carefu... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
4992b312-e060-514c-8070-1806ded88e6e | docs | nodejs | nodejs_tls | 6x | 48 | A key is *required* for ciphers that make use of certificates. Either `key` or
`pfx` can be used to provide it.
If the 'ca' option is not 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.create... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
99b532ae-8da9-5e62-89b0-5484e107df1a | docs | nodejs | nodejs_tls | 6x | 49 | + `requestCert` [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) If `true` the server will request a certificate from
clients that connect and attempt to verify that certificate. Defaults to
`false`.
+ `rejectUnauthorized` [<boolean>](https://developer.mozill... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
b40678bc-ec41-5cb6-b55c-0b1c3defdc09 | docs | nodejs | nodejs_tls | 6x | 50 | + `ALPNProtocols` [<string[]>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | [<Buffer>](buffer.html#buffer_class_buffer) An array of strings or a `Buffer` naming
possible ALPN protocols. (Protocols should be ordered by their priority.)
When the server receives both NPN... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
42bb6a98-79a3-5385-bfc4-bdd6dc6c8890 | docs | nodejs | nodejs_tls | 6x | 51 | + `sessionTimeout` [<number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) An integer specifying the number of seconds after
which the TLS session identifiers and TLS session tickets created by the
server will time out. See [SSL\_CTX\_set\_timeout](https://www.openssl.o... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
2f59599d-ddfc-5402-a7be-505243431fd0 | docs | nodejs | nodejs_tls | 6x | 52 | Creates a new [tls.Server](#tls_class_tls_server). The `secureConnectionListener`, if provided, is
automatically set as a listener for the [`'secureConnection'`](#tls_event_secureconnection) event.
The following illustrates a simple echo server:
```None
const tls = require('tls');
const fs = require('fs');
const opt... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
18ace05d-c828-5b19-aaed-3179bf4fe0ba | docs | nodejs | nodejs_tls | 6x | 53 | const options = {
pfx: fs.readFileSync('server.pfx'),
// This is necessary only if using the client certificate authentication.
requestCert: true,
};
const server = tls.createServer(options, (socket) => {
console.log('server connected',
socket.authorized ? 'authorized' : 'unauthorized');
sock... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
30df8c61-2a00-5027-9331-f457d6121690 | docs | nodejs | nodejs_tls | 6x | 54 | ## tls.DEFAULT\_ECDH\_CURVE[#](#tls_tls_default_ecdh_curve)
Added in: v0.11.13
The default curve name to use for ECDH key agreement in a tls server. The
default value is `'prime256v1'` (NIST P-256). Consult [RFC 4492](https://www.rfc-editor.org/rfc/rfc4492.txt) and
[FIPS.186-4](http://nvlpubs.nist.gov/nistpubs/FIPS/N... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
f1830252-f45e-5a8d-bda2-98b1d58b1002 | docs | nodejs | nodejs_tls | 6x | 55 | written to the underlying socket *including* the bytes required for the
implementation of the TLS protocol.
### Class: SecurePair[#](#tls_class_securepair)
Added in: v0.3.2
Deprecated since: v0.11.3
[Stability: 0](documentation.html#documentation_stability_index) - Deprecated: Use [`tls.TLSSocket`](#tls_class_tls_tl... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
91becdf5-eb0e-531f-9c88-483e95278833 | docs | nodejs | nodejs_tls | 6x | 56 | ### tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized][, options])[#](#tls_tls_createsecurepair_context_isserver_requestcert_rejectunauthorized_options)
Added in: v0.3.2
Deprecated since: v0.11.3
[Stability: 0](documentation.html#documentation_stability_index) - Deprecated: Use [`tls.TLSS... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
fcc805ea-62d2-5337-ab51-21eb2b9505ec | docs | nodejs | nodejs_tls | 6x | 57 | * `rejectUnauthorized` [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) `true` to specify whether a server should
automatically reject clients with invalid certificates. Only applies when
`isServer` is `true`.
* `options`
+ `secureContext`: An optional TLS context ... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
8d49d903-bd50-5370-9245-ff4c00a8caf2 | docs | nodejs | nodejs_tls | 6x | 58 | + `ALPNProtocols`: Optional, see [`tls.createServer()`](#tls_tls_createserver_options_secureconnectionlistener)
+ `SNICallback`: Optional, see [`tls.createServer()`](#tls_tls_createserver_options_secureconnectionlistener)
+ `session` [<Buffer>](buffer.html#buffer_class_buffer) An optional `Buffer` instance contai... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
49d07757-54e2-5ce9-bfa5-27341ecb8ea5 | docs | nodejs | nodejs_tls | 6x | 59 | `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and
`encrypted` stream properties.
*Note*: `cleartext` has the same API as [`tls.TLSSocket`](#tls_class_tls_tlssocket).
*Note*: The `tls.createSecurePair()` method is now deprecated in favor of
`tls.TLSSocket()`. For example, the code:
```No... | large_dataset/raw/docs/nodejs/tls/tls_6x.md |
451e1f96-3508-513f-bc12-4a9203d719cb | docs | nodejs | nodejs_tls | 7x | 0 | # TLS (SSL)#
Source: https://nodejs.org/docs/latest-v7.x/api/tls.html
Version: 7.x
```None
Stability: 2 - 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 module can be accessed using:
```None
co... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
6432e5c4-f90d-5b90-b4b3-2001e48fca79 | docs | nodejs | nodejs_tls | 7x | 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_7x.md |
3a79b2c0-5075-57e2-85ed-83a65d9629f9 | docs | nodejs | nodejs_tls | 7x | 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_7x.md |
289236e6-b7b8-58f8-80ba-45a7803ab942 | docs | nodejs | nodejs_tls | 7x | 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_7x.md |
d79ad6fb-ba7b-5a98-9dd1-c15bfe465d86 | docs | nodejs | nodejs_tls | 7x | 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 name of an alternative
curve to use, see [`tls.createServer()`](#tls_tls_createserver_options_secureconnectionlistener) for more info.
### ALPN, NPN and SNI[#](#tls_alpn_npn_and_sni)
ALP... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
c788f210-5d7b-5c2a-8544-517fe0c6e842 | docs | nodejs | nodejs_tls | 7x | 5 | ### Client-initiated renegotiation attack mitigation[#](#tls_client_initiated_renegotiation_attack_mitigation)
The TLS protocol allows clients to renegotiate certain aspects of the TLS
session. Unfortunately, session renegotiation requires a disproportionate amount
of server-side resources, making it a potential vecto... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
0d04bdce-060f-544f-9edc-837f787aea8b | docs | nodejs | nodejs_tls | 7x | 6 | *Note*: The default renegotiation limits should not be modified without a full
understanding of the implications and risks.
To test the renegotiation limits on a server, connect to it using the OpenSSL
command-line client (`openssl s_client -connect address:port`) then input
`R<CR>` (i.e., the letter `R` followed by a... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
5102cdb7-0e34-5618-b97c-69a7c3681a24 | docs | nodejs | nodejs_tls | 7x | 7 | line switch. For instance, the following makes
`ECDHE-RSA-AES128-GCM-SHA256:!RC4` the default TLS cipher suite:
```None
node --tls-cipher-list="ECDHE-RSA-AES128-GCM-SHA256:!RC4"
```
The default can also be replaced on a per client or server basis using the
`ciphers` option from [`tls.createSecureContext()`](#tls_tls_... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
30156a6c-53f4-5daf-9ca5-d2e392e29584 | docs | nodejs | nodejs_tls | 7x | 8 | of an application. The `--tls-cipher-list` switch and `ciphers` option should by
used only if absolutely necessary.
The default cipher suite prefers GCM ciphers for [Chrome's 'modern
cryptography' setting](https://www.chromium.org/Home/chromium-security/education/tls#TOC-Cipher-Suites) and also prefers ECDHE and DHE c... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
436ffb35-5d63-51d7-ae24-2a1e99a33a94 | docs | nodejs | nodejs_tls | 7x | 9 | on the format, see the [OpenSSL cipher list format documentation](https://www.openssl.org/docs/man1.0.2/apps/ciphers.html#CIPHER-LIST-FORMAT).
## Class: tls.Server[#](#tls_class_tls_server)
Added in: v0.3.2
The `tls.Server` class is a subclass of `net.Server` that accepts encrypted
connections using TLS or SSL.
###... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
e63d9d82-2edb-57f3-a5f2-d7948caa2ad7 | docs | nodejs | nodejs_tls | 7x | 10 | established after the addition of the event listener.
### Event: 'OCSPRequest'[#](#tls_event_ocsprequest)
Added in: v0.11.13
The `'OCSPRequest'` event is emitted when the client sends a certificate status
request. The listener callback is passed three arguments when called:
* `certificate` [<Buffer>](buffer.html#bu... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
01186819-d676-5e4b-b995-354437b6908b | docs | nodejs | nodejs_tls | 7x | 11 | certificate ID and OCSP endpoint URL.
Alternatively, `callback(null, null)` may be called, indicating that there was
no OCSP response.
Calling `callback(err)` will result in a `socket.destroy(err)` call.
The typical flow of an OCSP Request is as follows:
1. Client connects to the server and sends an `'OCSPRequest'`... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
ab08a9fa-87dd-5aa5-a8c0-3b68d184c2c2 | docs | nodejs | nodejs_tls | 7x | 12 | via the `ca` option when establishing the TLS connection.)
*Note*: Listening for this event will have an effect only on connections
established after the addition of the event listener.
*Note*: An npm module like [asn1.js](https://npmjs.org/package/asn1.js) may be used to parse the certificates.
### Event: 'resumeSe... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
ab83847a-5e40-5c53-adb4-deda95a8310d | docs | nodejs | nodejs_tls | 7x | 13 | be invoked as `callback(null, null)`. Calling `callback(err)` will terminate the
incoming connection and destroy the socket.
*Note*: Listening for this event will have an effect only on connections
established after the addition of the event listener.
The following illustrates resuming a TLS session:
```None
const t... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
e1652a1e-2180-5cdf-8de5-8cb07cd552cc | docs | nodejs | nodejs_tls | 7x | 14 | client has been verified by one of the supplied Certificate Authorities for the
server. If `tlsSocket.authorized` is `false`, then `socket.authorizationError`
is set to describe how authorization failed. Note that depending on the settings
of the TLS server, unauthorized connections may still be accepted.
The `tlsSock... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
9177a5fc-275d-56fe-bbe7-1e8411b1b78b | docs | nodejs | nodejs_tls | 7x | 15 | * `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_7x.md |
31dcd8a5-1e34-5813-b646-2899e44dc045 | docs | nodejs | nodejs_tls | 7x | 16 | ### server.address()[#](#tls_server_address)
Added in: v0.6.0
Returns the bound address, the address family name, and port of the
server as reported by the operating system. See [`net.Server.address()`](net.html#net_server_address) for
more information.
### server.close([callback])[#](#tls_server_close_callback)
Ad... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
d11ced92-8f62-550a-a024-df583a51dd9b | docs | nodejs | nodejs_tls | 7x | 17 | ### server.getTicketKeys()[#](#tls_server_getticketkeys)
Added in: v3.0.0
Returns a `Buffer` instance holding the keys currently used for
encryption/decryption of the [TLS Session Tickets](https://www.ietf.org/rfc/rfc5077.txt)
### server.listen(port[, hostname][, callback])[#](#tls_server_listen_port_hostname_callba... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
278ae4ec-ff7b-50d7-9e1e-e7baa1f945ca | docs | nodejs | nodejs_tls | 7x | 18 | * `callback` [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) A callback function to be invoked when the server has
begun listening on the `port` and `hostname`.
The `server.listen()` methods instructs the server to begin accepting
connections on the specified `... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
add18bc4-5c92-5379-9d62-a6be87e27a03 | docs | nodejs | nodejs_tls | 7x | 19 | [tls.createServer](#tls_tls_createserver_options_secureconnectionlistener) for
more information on how it is used.
*Note*: Changes to the ticket keys are effective only for future server
connections. Existing or currently pending server connections will use the
previous keys.
## Class: tls.TLSSocket[#](#tls_class_tls... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
cc432f9d-1b66-5c5f-8933-ec165163dbdd | docs | nodejs | nodejs_tls | 7x | 20 | ### new tls.TLSSocket(socket[, options])[#](#tls_new_tls_tlssocket_socket_options)
History
| Version | Changes |
| --- | --- |
| v5.0.0 | ALPN options are supported now. |
| v0.11.4 | Added in: v0.11.4 |
* `socket` [<net.Socket>](net.html#net_class_net_socket) An instance of [`net.Socket`](net.html#net_class_net_soc... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
cb7c1fa5-4e1c-5e51-aa73-14672aa34381 | docs | nodejs | nodejs_tls | 7x | 21 | + `rejectUnauthorized`: Optional, see [`tls.createServer()`](#tls_tls_createserver_options_secureconnectionlistener)
+ `NPNProtocols`: Optional, see [`tls.createServer()`](#tls_tls_createserver_options_secureconnectionlistener)
+ `ALPNProtocols`: Optional, see [`tls.createServer()`](#tls_tls_createserver_options_... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
7519fbd9-f720-5790-a855-b810e51da9e5 | docs | nodejs | nodejs_tls | 7x | 22 | [`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()`. *Note*: In effect, all
[`tls.createSecureContext()`](#tls_tls_createsecurecontext_options) options can b... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
1e6e34bb-7889-5e0b-aaa9-a7a06692ace2 | docs | nodejs | nodejs_tls | 7x | 23 | * `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: 'secureConnect'[#](#tls_event_secureconnect)
Added in: v0.11.4
The `'secu... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
da24a3a6-cd35-58b6-bf6c-c3426696771f | docs | nodejs | nodejs_tls | 7x | 24 | ### tlsSocket.address()[#](#tls_tlssocket_address)
Added in: v0.11.4
Returns the bound address, the address family name, and port of the
underlying socket as reported by the operating system. Returns an
object with three properties, e.g.,
`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`
### tlsSocket.authoriz... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
649b37b6-30ed-5980-91b0-1908da2f890d | docs | nodejs | nodejs_tls | 7x | 25 | ### tlsSocket.getCipher()[#](#tls_tlssocket_getcipher)
Added in: v0.11.4
Returns an object representing the cipher name and the SSL/TLS protocol version
that first defined the cipher.
For example: `{ name: 'AES256-SHA', version: 'TLSv1/SSLv3' }`
See `SSL_CIPHER_get_name()` and `SSL_CIPHER_get_version()` in
<https:/... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
cd223b47-4cc1-59b9-8087-195549bb00f3 | docs | nodejs | nodejs_tls | 7x | 26 | ### tlsSocket.getPeerCertificate([ detailed ])[#](#tls_tlssocket_getpeercertificate_detailed)
Added in: v0.11.4
* `detailed` [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) Include the full certificate chain if `true`, otherwise
include just the peer's certificate.
... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
35f975fb-4aa1-5f15-ada8-4a2495507a24 | docs | nodejs | nodejs_tls | 7x | 27 | { ... another certificate, possibly with a .issuerCertificate ... },
raw: < RAW DER buffer >,
valid_from: 'Nov 11 09:52:22 2009 GMT',
valid_to: 'Nov 6 09:52:22 2029 GMT',
fingerprint: '2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:5A:71:38:52:EC:8A:DF',
serialNumber: 'B9B0D332A1AA5635' }
```
If the peer does no... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
7608394d-7351-54a3-a121-62a9aa4e59a4 | docs | nodejs | nodejs_tls | 7x | 28 | ### tlsSocket.getSession()[#](#tls_tlssocket_getsession)
Added in: v0.11.4
Returns the ASN.1 encoded TLS session or `undefined` if no session was
negotiated. Can be used to speed up handshake establishment when reconnecting
to the server.
### tlsSocket.getTLSTicket()[#](#tls_tlssocket_gettlsticket)
Added in: v0.11.... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
02ced8ba-6284-5d41-b626-aa4b087d8c48 | docs | nodejs | nodejs_tls | 7x | 29 | ### tlsSocket.remoteAddress[#](#tls_tlssocket_remoteaddress)
Added in: v0.11.4
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
Returns the string representation of the... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
bcacf117-d857-59a4-9de7-ea73a1ee7ccb | docs | nodejs | nodejs_tls | 7x | 30 | * `callback` [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) A function that will be called when the renegotiation
request has been completed.
The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process.
Upon completion, the `callback` function w... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
2c37fd2c-ce04-52ce-9ae3-82377d51130b | docs | nodejs | nodejs_tls | 7x | 31 | Returns `true` if setting the limit succeeded; `false` otherwise.
Smaller fragment sizes decrease the buffering latency on the client: larger
fragments are buffered by the TLS layer until the entire fragment is received
and its integrity is verified; large fragments can span multiple roundtrips
and their processing ca... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
882756ad-adf9-5248-8801-d7fcd07b1d3c | docs | nodejs | nodejs_tls | 7x | 32 | + `host` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) Host the client should connect to, defaults to 'localhost'.
+ `port` [<number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) Port the client should connect to.
+ `path` ... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
021e3d1f-54c0-579c-89fb-2bd5f647f301 | docs | nodejs | nodejs_tls | 7x | 33 | + `rejectUnauthorized` [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) 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 OpenSSL error code. Defaults to
... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
ecc406cc-c331-503d-89c6-ba92eeba2af6 | docs | nodejs | nodejs_tls | 7x | 34 | containing the supported ALPN protocols. `Buffer`s should have the format
`[len][name][len][name]...` e.g. `0x05hello0x05world`, where the first byte
is the length of the next protocol name. Passing an array is usually much
simpler: `['hello', 'world']`.)
+ `servername`: [<string>](https://developer.m... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
40c5b4ea-fafd-56f0-b546-e895f88ca8f4 | docs | nodejs | nodejs_tls | 7x | 35 | + `minDHSize` [<number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) Minimum size of the DH parameter in bits to accept a
TLS connection. When a server offers a DH parameter with a size less
than `minDHSize`, the TLS connection is destroyed and an error is thrown.
... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
58f2ab75-4864-587c-80d1-93faf5ac830c | docs | nodejs | nodejs_tls | 7x | 36 | * `callback` [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)
The `callback` function, if specified, will be added as a listener for the
[`'secureConnect'`](#tls_event_secureconnect) event.
`tls.connect()` returns a [`tls.TLSSocket`](#tls_class_tls_tlssocket) obj... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
01ab0290-7151-5865-bd7e-aff7209ccce9 | docs | nodejs | nodejs_tls | 7x | 37 | });
socket.on('end', () => {
server.close();
});
```
Or
```None
const tls = require('tls');
const fs = require('fs');
const options = {
pfx: fs.readFileSync('client.pfx')
};
const socket = tls.connect(8000, options, () => {
console.log('client connected',
socket.authorized ? 'authorized' : 'unau... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
204d8ab7-1d61-56d7-a491-10422cb44499 | docs | nodejs | nodejs_tls | 7x | 38 | * `callback` [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) See [`tls.connect()`](#tls_tls_connect_options_callback).
Same as [`tls.connect()`](#tls_tls_connect_options_callback) except that `path` can be provided
as an argument instead of an option.
*Note*: A ... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
81a69160-d64b-51e8-a02a-7cb0b14a2354 | docs | nodejs | nodejs_tls | 7x | 39 | * `callback` [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) See [`tls.connect()`](#tls_tls_connect_options_callback).
Same as [`tls.connect()`](#tls_tls_connect_options_callback) except that `port` and `host` can be provided
as arguments instead of options.
*No... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
1f1dcd9d-e804-56b6-9ded-9aa6e3442f20 | docs | nodejs | nodejs_tls | 7x | 40 | + `pfx` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | [<Buffer>](buffer.html#buffer_class_buffer) Optional PFX or PKCS12 encoded private key and
certificate chain. `pfx` is an alternative to providing `key` and `cert`
individually. PFX is usually encrypted, ... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
09202c89-ac5c-5027-af19-ee4cc2f11643 | docs | nodejs | nodejs_tls | 7x | 41 | different algorithms can be provided either as an array of unencrypted key
strings or buffers, or an array of objects in the form `{pem:
<string|buffer>[, passphrase: <string>]}`. The object form can only occur in
an array. `object.passphrase` is optional. Encrypted keys will be decrypted
with `obje... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
40c42a56-5681-560f-88d2-98840c2bfbb3 | docs | nodejs | nodejs_tls | 7x | 42 | 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`). When providing multiple cert chains, they do not have to be in
the s... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
655d7953-ea46-590c-9ec5-63fcd490a9bb | docs | nodejs | nodejs_tls | 7x | 43 | using this option. The value can be a string or Buffer, or an Array of
strings and/or Buffers. Any string or Buffer can contain multiple PEM CAs
concatenated together. The peer's certificate must be chainable to a CA
trusted by the server for the connection to be authenticated. When using
certificat... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
77a883cc-fb99-58c8-8d8f-f4ab760af801 | docs | nodejs | nodejs_tls | 7x | 44 | + `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_buffer) Optional PEM formatt... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
2a8e17cd-c5b1-5ae6-baac-dbe75183e5de | docs | nodejs | nodejs_tls | 7x | 45 | *Note*: [`tls.createServer()`](#tls_tls_createserver_options_secureconnectionlistener) sets the default value to `true`, other
APIs that create secure contexts leave it unset.
+ `ecdhCurve` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) A string describing a na... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
6223742d-3d60-58f1-97bf-36a48cb5825e | docs | nodejs | nodejs_tls | 7x | 46 | The key length must be greater than or equal to 1024 bits, otherwise an
error will be thrown. It is strongly recommended to use 2048 bits or larger
for stronger security. If omitted or invalid, the parameters are silently
discarded and DHE ciphers will not be available.
+ `secureProtocol` [<string>](h... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
04d65630-06e6-5f66-aac6-a6b3b741cf4d | docs | nodejs | nodejs_tls | 7x | 47 | [OpenSSL Options](crypto.html#crypto_openssl_options).
+ `sessionIdContext` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) Optional opaque identifier used by servers to
ensure session state is not shared between applications. Unused by clients.
*Note*: [`tl... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
1da12b40-9fdc-50da-92c5-6412f40af7b0 | docs | nodejs | nodejs_tls | 7x | 48 | ## tls.createServer([options][, secureConnectionListener])[#](#tls_tls_createserver_options_secureconnectionlistener)
History
| Version | Changes |
| --- | --- |
| v5.0.0 | ALPN options are supported now. |
| v0.3.2 | Added in: v0.3.2 |
* `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/R... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
d4d1a246-3ebf-581a-a43f-c516ae51587e | docs | nodejs | nodejs_tls | 7x | 49 | + `rejectUnauthorized` [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) 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`. Defaults to `false`.
+ `N... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
88a5159d-01e0-5271-a8bd-8456115ea03f | docs | nodejs | nodejs_tls | 7x | 50 | extension to the client.
+ `SNICallback(servername, cb)` [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) A function that will be called if
the client supports SNI TLS extension. Two arguments will be passed when
called: `servername` and `cb`. `SNICal... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
777898b8-6eac-5a72-a241-505c212c62dc | docs | nodejs | nodejs_tls | 7x | 51 | + `ticketKeys`: A 48-byte `Buffer` instance consisting of a 16-byte prefix,
a 16-byte HMAC key, and a 16-byte AES key. This can be used to accept TLS
session tickets on multiple instances of the TLS server. *Note* that this is
automatically shared between `cluster` module workers.
+ ...: Any [`tls.creat... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
359f8f32-d3d7-5616-beec-66216a12490f | docs | nodejs | nodejs_tls | 7x | 52 | cert: fs.readFileSync('server-cert.pem'),
// This is necessary only if using the client certificate authentication.
requestCert: true,
// This is necessary only if the client uses the self-signed certificate.
ca: [ fs.readFileSync('client-cert.pem') ]
};
const server = tls.createServer(options, (socket) =>... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
f93ef846-020b-53a1-9449-2c8ce616e4e5 | docs | nodejs | nodejs_tls | 7x | 53 | socket.pipe(socket);
});
server.listen(8000, () => {
console.log('server bound');
});
```
This server can be tested by connecting to it using `openssl s_client`:
```None
openssl s_client -connect 127.0.0.1:8000
```
## tls.getCiphers()[#](#tls_tls_getciphers)
Added in: v0.10.2
Returns an array with the names of... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
43efe40e-1a8d-54c5-bc2e-49f76b8a7ea9 | docs | nodejs | nodejs_tls | 7x | 54 | ## Deprecated APIs[#](#tls_deprecated_apis)
### Class: CryptoStream[#](#tls_class_cryptostream)
Added in: v0.3.4Deprecated since: v0.11.3
```None
Stability: 0 - Deprecated: Use tls.TLSSocket instead.
```
The `tls.CryptoStream` class represents a stream of encrypted data. This class
has been deprecated and should no... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
f82b82dc-8480-528e-9878-0e21cf8daaa8 | docs | nodejs | nodejs_tls | 7x | 55 | #### Event: 'secure'[#](#tls_event_secure)
Added in: v0.3.2Deprecated since: v0.11.3
The `'secure'` event is emitted by the `SecurePair` object once a secure
connection has been established.
As with checking for the server [`secureConnection`](#tls_event_secureconnection)
event, `pair.cleartext.authorized` should be... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
51b11be4-bba3-5a3f-a05f-7a576eb6d182 | docs | nodejs | nodejs_tls | 7x | 56 | * `isServer` [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) `true` to specify that this TLS connection should be
opened as a server.
* `requestCert` [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) `true` to specify wh... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
823cac8d-3440-5019-87a5-b7f29af24ad1 | docs | nodejs | nodejs_tls | 7x | 57 | + `server` <net.Server> An optional [`net.Server`](net.html#net_class_net_server) instance
+ `requestCert`: Optional, see [`tls.createServer()`](#tls_tls_createserver_options_secureconnectionlistener)
+ `rejectUnauthorized`: Optional, see [`tls.createServer()`](#tls_tls_createserver_options_secureconnectionlisten... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
0bc18a86-0b1e-5471-8d5a-af1fd7193ffb | docs | nodejs | nodejs_tls | 7x | 58 | will be emitted on the socket before establishing a secure communication
Creates a new secure pair object with two streams, one of which reads and writes
the encrypted data and the other of which reads and writes the cleartext data.
Generally, the encrypted stream is piped to/from an incoming encrypted data
stream... | large_dataset/raw/docs/nodejs/tls/tls_7x.md |
81c90974-1aea-5b7c-a604-7eeee5c358cb | docs | nodejs | nodejs_tls | 8x | 0 | # TLS (SSL)#
Source: https://nodejs.org/docs/latest-v8.x/api/tls.html
Version: 8.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 m... | large_dataset/raw/docs/nodejs/tls/tls_8x.md |
6b9bf781-197d-5140-a189-5ad6fdf41c01 | docs | nodejs | nodejs_tls | 8x | 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_8x.md |
ea7a881c-18b3-549d-b3c3-c2aa26986aad | docs | nodejs | nodejs_tls | 8x | 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_8x.md |
49010bdf-2211-5c4e-8b9e-446fec0f3c9f | docs | nodejs | nodejs_tls | 8x | 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_8x.md |
2c82983b-7bce-596c-907c-0f4f5068c85d | docs | nodejs | nodejs_tls | 8x | 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, NPN, and SNI[#](#tls_alpn_npn_and_sni... | large_dataset/raw/docs/nodejs/tls/tls_8x.md |
4e5105d7-4699-5a74-bc91-5f7183c25da8 | docs | nodejs | nodejs_tls | 8x | 5 | ### Client-initiated renegotiation attack mitigation[#](#tls_client_initiated_renegotiation_attack_mitigation)
The TLS protocol allows clients to renegotiate certain aspects of the TLS
session. Unfortunately, session renegotiation requires a disproportionate amount
of server-side resources, making it a potential vecto... | large_dataset/raw/docs/nodejs/tls/tls_8x.md |
298e0b44-28aa-54f3-a0d8-d5fc23d8f834 | docs | nodejs | nodejs_tls | 8x | 6 | *Note*: The default renegotiation limits should not be modified without a full
understanding of the implications and risks.
To test the renegotiation limits on a server, connect to it using the OpenSSL
command-line client (`openssl s_client -connect address:port`) then input
`R<CR>` (i.e., the letter `R` followed by a... | large_dataset/raw/docs/nodejs/tls/tls_8x.md |
c29842cc-6989-554c-874a-aefbc151eafe | docs | nodejs | nodejs_tls | 8x | 7 | line switch. For instance, the following makes
`ECDHE-RSA-AES128-GCM-SHA256:!RC4` the default TLS cipher suite:
```None
node --tls-cipher-list="ECDHE-RSA-AES128-GCM-SHA256:!RC4"
```
The default can also be replaced on a per client or server basis using the
`ciphers` option from [`tls.createSecureContext()`](#tls_tls_... | large_dataset/raw/docs/nodejs/tls/tls_8x.md |
41fec42a-ee4d-5301-893f-3951e60b7247 | docs | nodejs | nodejs_tls | 8x | 8 | of an application. The `--tls-cipher-list` switch and `ciphers` option should by
used only if absolutely necessary.
The default cipher suite prefers GCM ciphers for [Chrome's 'modern
cryptography' setting](https://www.chromium.org/Home/chromium-security/education/tls#TOC-Cipher-Suites) and also prefers ECDHE and DHE c... | large_dataset/raw/docs/nodejs/tls/tls_8x.md |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.