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 |
|---|---|---|---|---|---|---|---|
21b53eb8-5243-5c15-bb6a-5114cdeff466 | docs | nodejs | nodejs_tls | 10x | 72 | ## tls.DEFAULT\_ECDH\_CURVE[#](#tls_tls_default_ecdh_curve)
History
| Version | Changes |
| --- | --- |
| v10.0.0 | Default value changed to `'auto'`. |
| v0.11.13 | Added in: v0.11.13 |
The default curve name to use for ECDH key agreement in a tls server. The
default value is `'auto'`. See [`tls.createSecureContext... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
c7cc38d6-1df6-5318-8d2f-0cf200ab2897 | docs | nodejs | nodejs_tls | 10x | 73 | ## tls.DEFAULT\_MIN\_VERSION[#](#tls_tls_default_min_version)
Added in: v10.6.0
* [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) The default value of the `minVersion` option of
[`tls.createSecureContext()`](#tls_tls_createsecurecontext_options). It can be assigned an... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
f5419328-d636-5fa6-9d60-f37bc1938402 | docs | nodejs | nodejs_tls | 10x | 74 | The `tls.CryptoStream` class represents a stream of encrypted data. This class
is deprecated and should no longer be used.
#### cryptoStream.bytesWritten[#](#tls_cryptostream_byteswritten)
Added in: v0.3.4Deprecated since: v0.11.3
The `cryptoStream.bytesWritten` property returns the total number of bytes
written to ... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
59bc6342-8384-582c-8e8b-28d9f603f41b | docs | nodejs | nodejs_tls | 10x | 75 | [`'secureConnection'`](#tls_event_secureconnection)
event, `pair.cleartext.authorized` should be inspected to confirm whether the
certificate used is properly authorized.
### tls.createSecurePair([context][, isserver][, requestCert][, rejectunauthorized][, options])[#](#tls_tls_createsecurepair_context_isserver_reques... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
858f972e-6601-5151-9ed9-2b729ee646e0 | docs | nodejs | nodejs_tls | 10x | 76 | * `requestCert` [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) `true` to specify whether a server should request a
certificate from a connecting client. Only applies when `isServer` is `true`.
* `rejectUnauthorized` [<boolean>](https://developer.mozilla.org/en-US/doc... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
9ddc3bac-68c7-573f-8459-d91fe76b7d52 | docs | nodejs | nodejs_tls | 10x | 77 | + `rejectUnauthorized`: See [`tls.createServer()`](#tls_tls_createserver_options_secureconnectionlistener)
+ `ALPNProtocols`: See [`tls.createServer()`](#tls_tls_createserver_options_secureconnectionlistener)
+ `SNICallback`: See [`tls.createServer()`](#tls_tls_createserver_options_secureconnectionlistener)
+ `... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
d12b24fd-f03a-5ba9-b5cd-2da004449ca0 | docs | nodejs | nodejs_tls | 10x | 78 | stream and the cleartext one is used as a replacement for the initial encrypted
stream.
`tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and
`encrypted` stream properties.
Using `cleartext` has the same API as [`tls.TLSSocket`](#tls_class_tls_tlssocket).
The `tls.createSecurePair()` method... | large_dataset/raw/docs/nodejs/tls/tls_10x.md |
8944acac-dfdb-5d4c-8671-daf532c4f64c | docs | nodejs | nodejs_tls | 11x | 0 | # TLS (SSL)#
Source: https://nodejs.org/docs/latest-v11.x/api/tls.html
Version: 11.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_11x.md |
7277523b-9f3b-5758-9119-318db98083a3 | docs | nodejs | nodejs_tls | 11x | 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_11x.md |
300fefd2-35d0-5511-a8ba-7a33d9754dfe | docs | nodejs | nodejs_tls | 11x | 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_11x.md |
441b7b56-6db2-5889-a982-0f5e682a21c0 | docs | nodejs | nodejs_tls | 11x | 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_11x.md |
d02661f6-6b26-599c-b70f-4f0fe1465c31 | docs | nodejs | nodejs_tls | 11x | 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.
Perfect Forward Secrecy was optional up to TLSv... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
6ad2f056-a998-5b63-881d-252d123f7cae | docs | nodejs | nodejs_tls | 11x | 5 | of server-side resources, making it a potential vector for denial-of-service
attacks.
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:
... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
f5eaae28-d27a-5cb2-9d4e-4c3b33c0cb39 | docs | nodejs | nodejs_tls | 11x | 6 | ### Session Resumption[#](#tls_session_resumption)
Establishing a TLS session can be relatively slow. The process can be sped
up by saving and later reusing the session state. There are several mechanisms
to do so, discussed here from oldest to newest (and preferred).
***Session Identifiers*** Servers generate a uniq... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
eaea5abb-2d55-567d-bd6c-ef95cc63f1e6 | docs | nodejs | nodejs_tls | 11x | 7 | to reuse the session. Servers must
implement handlers for the [`'newSession'`](#tls_event_newsession) and [`'resumeSession'`](#tls_event_resumesession) events
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,
server... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
a9079cb0-740f-5c88-8ddb-6d7bc4196fa4 | docs | nodejs | nodejs_tls | 11x | 8 | For Node.js, clients use the same APIs for resumption with session identifiers
as for resumption with session tickets. For debugging, if
[`tls.TLSSocket.getTLSTicket()`](#tls_tlssocket_gettlsticket) returns a value, the session data contains a
ticket, otherwise it contains client-side session state.
With TLSv1.3, be a... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
7fe1dbb1-1fd3-5cec-b294-ac490a5e23d0 | docs | nodejs | nodejs_tls | 11x | 9 | securely generate 48 bytes of secure random data and set them with the
`ticketKeys` option of [`tls.createServer()`](#tls_tls_createserver_options_secureconnectionlistener). The keys should be regularly
regenerated and server's keys can be reset with
[`server.setTicketKeys()`](#tls_server_setticketkeys_keys).
Session ... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
c5054734-f375-5872-be82-8faf9b80d77a | docs | nodejs | nodejs_tls | 11x | 10 | For all the mechanisms, when resumption fails, servers will create new sessions.
Since failing to resume the session does not cause TLS/HTTPS connection
failures, it is easy to not notice unnecessarily poor TLS performance. The
OpenSSL CLI can be used to verify that servers are resuming sessions. Use the
`-reconnect` o... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
856c63c7-e56e-5094-8f9f-df828825a771 | docs | nodejs | nodejs_tls | 11x | 11 | ECDHE-RSA-AES128-GCM-SHA256:
ECDHE-ECDSA-AES128-GCM-SHA256:
ECDHE-RSA-AES256-GCM-SHA384:
ECDHE-ECDSA-AES256-GCM-SHA384:
DHE-RSA-AES128-GCM-SHA256:
ECDHE-RSA-AES128-SHA256:
DHE-RSA-AES128-SHA256:
ECDHE-RSA-AES256-SHA384:
DHE-RSA-AES256-SHA384:
ECDHE-RSA-AES256-SHA256:
DHE-RSA-AES256-SHA256:
HIGH:
!aNULL:
!eNULL:
!EXPORT... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
41601f3b-7518-5231-b711-c8904b61589a | docs | nodejs | nodejs_tls | 11x | 12 | `ciphers` option from [`tls.createSecureContext()`](#tls_tls_createsecurecontext_options), which is also available
in [`tls.createServer()`](#tls_tls_createserver_options_secureconnectionlistener), [`tls.connect()`](#tls_tls_connect_options_callback), and when creating new
[`tls.TLSSocket`](#tls_class_tls_tlssocket)s.
... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
560288cb-da8f-5f6c-b816-d8104bdf99e2 | docs | nodejs | nodejs_tls | 11x | 13 | Despite the relative order of TLSv1.3 and TLSv1.2 cipher suites, the TLSv1.3
protocol is significantly more secure than TLSv1.2, and will always be chosen
over TLSv1.2 if the handshake indicates it is supported, and if any TLSv1.3
cipher suites are enabled.
The default cipher suite included within Node.js has been car... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
5aeb4911-cdc7-594d-8994-17e76be96524 | docs | nodejs | nodejs_tls | 11x | 14 | attacks affecting larger AES key sizes](https://www.schneier.com/blog/archives/2009/07/another_new_aes.html).
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... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
3c554cf4-858d-534b-baf4-7726810006c3 | docs | nodejs | nodejs_tls | 11x | 15 | ## 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.
### Event: 'newSession'[#](#tls_event_newsession)
Added in: v0.9.2
The `'newSession'` event is emitted upon creation of a new TLS session. This m... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
37940241-4eed-54cc-9d1d-4bd099f985d3 | docs | nodejs | nodejs_tls | 11x | 16 | 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#buffer_class_b... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
f2fda7d4-b6ee-5958-84ae-e6146d86a0d7 | docs | nodejs | nodejs_tls | 11x | 17 | 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_11x.md |
ed190c33-2c50-50fa-a768-9b5d8604c1a9 | docs | nodejs | nodejs_tls | 11x | 18 | via the `ca` option when establishing the TLS connection.)
Listening for this event will have an effect only on connections established
after the addition of the event listener.
An npm module like [asn1.js](https://www.npmjs.com/package/asn1.js) may be used to parse the certificates.
### Event: 'resumeSession'[#](#t... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
57047ef3-fced-5552-9b32-349c5f17ffbe | docs | nodejs | nodejs_tls | 11x | 19 | The event listener should perform a lookup in external storage for the
`sessionData` saved by the [`'newSession'`](#tls_event_newsession) event handler using the given
`sessionId`. If found, call `callback(null, sessionData)` to resume the session.
If not found, the session cannot be resumed. `callback()` must be calle... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
e7f8d6de-56dc-559b-88d7-af85a8950ef3 | docs | nodejs | nodejs_tls | 11x | 20 | ### Event: 'secureConnection'[#](#tls_event_secureconnection)
Added in: v0.3.2
The `'secureConnection'` event is emitted after the handshaking process for a
new connection has successfully completed. The listener callback is passed a
single argument when called:
* `tlsSocket` [<tls.TLSSocket>](tls.html#tls_class_tls... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
bf6d3477-4a5e-5090-886d-6bde0aea6c60 | docs | nodejs | nodejs_tls | 11x | 21 | ### Event: 'tlsClientError'[#](#tls_event_tlsclienterror)
Added in: v6.0.0
The `'tlsClientError'` event is emitted when an error occurs before a secure
connection is established. The listener callback is passed two arguments when
called:
* `exception` [<Error>](https://developer.mozilla.org/en-US/docs/Web/JavaScript... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
91b100f0-e3e1-57e3-ab17-73967f26d3fc | docs | nodejs | nodejs_tls | 11x | 22 | from the [`tls.createSecureContext()`](#tls_tls_createsecurecontext_options) `options` arguments (e.g. `key`,
`cert`, `ca`, etc).
The `server.addContext()` method adds a secure context that will be used if
the client request's SNI name matches the supplied `hostname` (or wildcard).
### server.address()[[src]](htt... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
3a2193df-1ad9-5e8b-9974-ab0ac5327443 | docs | nodejs | nodejs_tls | 11x | 23 | * `callback` [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) A listener callback that will be registered to listen
for the server instance's `'close'` event.
* Returns: [<tls.Server>](tls.html#tls_class_tls_server)
The `server.close()` method stops the server f... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
57f33daa-aaca-5e3a-9da5-fe19e5562876 | docs | nodejs | nodejs_tls | 11x | 24 | ### server.getTicketKeys()[#](#tls_server_getticketkeys)
Added in: v3.0.0
* Returns: [<Buffer>](buffer.html#buffer_class_buffer) A 48-byte buffer containing the session ticket keys.
Returns the session ticket keys.
See [Session Resumption](#tls_session_resumption) for more information.
### server.listen()[[src]](h... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
460ce8a6-dbb7-59b7-a439-542eb7c4e557 | docs | nodejs | nodejs_tls | 11x | 25 | The `server.setSecureContext()` method replaces the secure context of an
existing server. Existing connections to the server are not interrupted.
### server.setTicketKeys(keys)[#](#tls_server_setticketkeys_keys)
Added in: v3.0.0
* `keys` [<Buffer>](buffer.html#buffer_class_buffer) A 48-byte buffer containing the ses... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
8a684182-463c-5f73-9f4d-f78c15bb3410 | docs | nodejs | nodejs_tls | 11x | 26 | [`tls.TLSSocket.getPeerCertificate()`](#tls_tlssocket_getpeercertificate_detailed) will only return data while the
connection is open.
### 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 ... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
f81f6fcd-edd9-5bb5-bc45-7b435756cb29 | docs | nodejs | nodejs_tls | 11x | 27 | instantiated as a server. **Default:** `false`.
+ `server` [<net.Server>](net.html#net_class_net_server) A [`net.Server`](net.html#net_class_net_server) instance.
+ `requestCert`: Whether to authenticate the remote peer by requesting a
certificate. Clients always request a server certificate. Servers
(`... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
48c0201c-4ef9-51e2-9812-e4d93631a953 | docs | nodejs | nodejs_tls | 11x | 28 | extension will be added to the client hello and an `'OCSPResponse'` event
will be emitted on the socket before establishing a secure communication
+ `secureContext`: TLS context object created with
[`tls.createSecureContext()`](#tls_tls_createsecurecontext_options). If a `secureContext` is *not* provided,... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
9dfeb2c6-b308-519a-859b-81363fdf5add | docs | nodejs | nodejs_tls | 11x | 29 | * `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_11x.md |
c13e99aa-361e-58c2-ad67-37bd80648c0a | docs | nodejs | nodejs_tls | 11x | 30 | ### Event: 'session'[#](#tls_event_session)
Added in: v11.10.0
* `session` [<Buffer>](buffer.html#buffer_class_buffer)
The `'session'` event is emitted on a client `tls.TLSSocket` when a new session
or TLS ticket is available. This may or may not be before the handshake is
complete, depending on the TLS protocol ver... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
2e89dafb-74d3-541f-8477-43c511ac30eb | docs | nodejs | nodejs_tls | 11x | 31 | by the protocol, multiple tickets are sent, and the tickets aren't sent until
later, after the handshake completes, so it is necessary to wait for the
`'session'` event to get a resumable session. Applications are
recommended to use the `'session'` event instead of `getSession()` to ensure
they will work for all TLS pr... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
84d14adc-72c4-51aa-bdaf-044b9583710d | docs | nodejs | nodejs_tls | 11x | 32 | ### tlsSocket.authorizationError[#](#tls_tlssocket_authorizationerror)
Added in: v0.11.4
Returns the reason why the peer's certificate was not been verified. This
property is set only when `tlsSocket.authorized === false`.
### tlsSocket.authorized[#](#tls_tlssocket_authorized)
Added in: v0.11.4
* Returns: [<boolea... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
4125725c-fe30-5756-b469-4e84747b02c9 | docs | nodejs | nodejs_tls | 11x | 33 | ### tlsSocket.getCertificate()[#](#tls_tlssocket_getcertificate)
Added in: v11.2.0
* Returns: [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
Returns an object representing the local certificate. The returned object has
some properties corresponding to the fields o... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
f0e985fc-b8e9-5b7c-a863-6d4c013bcad9 | docs | nodejs | nodejs_tls | 11x | 34 | <https://www.openssl.org/docs/man1.1.0/ssl/SSL_CIPHER_get_name.html> for more
information.
### 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 repr... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
e74ae322-8aa1-5c57-aaf7-79f07230ae9a | docs | nodejs | nodejs_tls | 11x | 35 | ### tlsSocket.getFinished()[#](#tls_tlssocket_getfinished)
Added in: v9.9.0
* Returns: [<Buffer>](buffer.html#buffer_class_buffer) | [<undefined>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type) The latest `Finished` message that has been
sent to the socket as part of a SSL/T... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
cf6bddf0-4d7f-56ce-977c-35ebd65f5d69 | docs | nodejs | nodejs_tls | 11x | 36 | ### 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_11x.md |
d658e13e-55c8-56c8-a6db-ce356995f8c7 | docs | nodejs | nodejs_tls | 11x | 37 | #### Certificate Object[#](#tls_certificate_object)
History
| Version | Changes |
| --- | --- |
| v11.4.0 | Support Elliptic Curve public key info. |
A certificate object has properties corresponding to the fields of the
certificate.
* `raw` [<Buffer>](buffer.html#buffer_class_buffer) The DER encoded X.509 certific... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
c56b7f95-f9d5-5176-83a1-0b72362322f9 | docs | nodejs | nodejs_tls | 11x | 38 | * `valid_from` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) The date-time the certificate is valid from.
* `valid_to` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) The date-time the certificate is valid to.
* `serialNum... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
9083cbc1-a7d6-57d1-b27a-84225bc7a6f2 | docs | nodejs | nodejs_tls | 11x | 39 | * `ext_key_usage` [<Array>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) (Optional) The extended key usage, a set of OIDs.
* `subjectaltname` [<Array>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) (Optional) An array of names for the ... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
aad3d905-dc7d-555d-8620-dde25be9e72b | docs | nodejs | nodejs_tls | 11x | 40 | * `bits` [<number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) The RSA bit size. Example: `1024`.
* `exponent` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) The RSA exponent, as a string in hexadecimal number
notation. Example... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
d19e7ad0-1476-56f1-9bb2-0e4065cd28e0 | docs | nodejs | nodejs_tls | 11x | 41 | curve. Well-known curves are identified by an OID. While it is unusual, it is
possible that the curve is identified by its mathematical properties, in which
case it will not have an OID. Example: `'prime256v1'`.
* `nistCurve` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Strin... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
285fc29f-6597-5dea-bfc0-c7cd5ad686d5 | docs | nodejs | nodejs_tls | 11x | 42 | modulus: 'B56CE45CB740B09A13F64AC543B712FF9EE8E4C284B542A1708A27E82A8D151CA178153E12E6DDA15BF70FFD96CB8A88618641BDFCCA03527E665B70D779C8A349A6F88FD4EF6557180BD4C98192872BCFE3AF56E863C09DDD8BC1EC58DF9D94F914F0369102B2870BECFA1348A0838C9C49BD1C20124B442477572347047506B1FCD658A80D0C44BCC16BC5C5496CFE6E4A8428EF654CD3D897... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
a4e57106-9f15-53a9-bc04-d5e6118b81b7 | docs | nodejs | nodejs_tls | 11x | 43 | 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_11x.md |
455a4fbb-c89a-58e9-9a23-781a781dca1a | docs | nodejs | nodejs_tls | 11x | 44 | (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 authentication
provided by SSL/TLS is not desired or is not enough.
Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used
to implement the `tls-unique` channel binding f... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
dda54435-7e90-5361-9bf4-6966b77ddd4a | docs | nodejs | nodejs_tls | 11x | 45 | * `'TLSv1.3'`
See <https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html> for more
information.
### 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,... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
b368e273-b834-5532-a732-dca5683e08f8 | docs | nodejs | nodejs_tls | 11x | 46 | It may be useful for debugging.
See [Session Resumption](#tls_session_resumption) for more information.
### 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 sessi... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
9e40f829-adff-5768-b8c4-1d0a5f193863 | docs | nodejs | nodejs_tls | 11x | 47 | ### tlsSocket.remoteAddress[#](#tls_tlssocket_remoteaddress)
Added in: v0.11.4
* [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)
Returns the string representation of the remote IP address. For example,
`'74.125.127.100'` or `'2001:4860:a005::68'`.
### tlsSocket.remote... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
8e92952e-3076-5145-b6f4-90c63f7dad3c | docs | nodejs | nodejs_tls | 11x | 48 | ### tlsSocket.renegotiate(options, callback)[#](#tls_tlssocket_renegotiate_options_callback)
Added in: v0.11.8
* `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)
+ `rejectUnauthorized` [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/D... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
e9316550-2127-53bd-9269-e5af79fa7c47 | docs | nodejs | nodejs_tls | 11x | 49 | * Returns: [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) `true` if renegotiation was initiated, `false` otherwise.
The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process.
Upon completion, the `callback` function will be passed a single argument
th... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
aee6f787-0cba-5f02-b127-65f2df96564f | docs | nodejs | nodejs_tls | 11x | 50 | * Returns: [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type)
The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size.
Returns `true` if setting the limit succeeded; `false` otherwise.
Smaller fragment sizes decrease the buffering latency on the cl... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
6d339731-1562-504c-a843-6aa842f85535 | docs | nodejs | nodejs_tls | 11x | 51 | against.
* `cert` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) A [certificate object](#tls_certificate_object) representing the peer's certificate.
* Returns: [<Error>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) | [<un... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
c3e5f204-4043-53c9-8361-7ec1bacde251 | docs | nodejs | nodejs_tls | 11x | 52 | the checks done with additional verification.
This function is only called if the certificate passed all other checks, such as
being issued by trusted CA (`options.ca`).
## tls.connect(options[, callback])[#](#tls_tls_connect_options_callback)
History
| Version | Changes |
| --- | --- |
| v11.8.0 | The `timeout` op... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
dd2da6a6-70e9-5645-b943-b6cf34ba412e | docs | nodejs | nodejs_tls | 11x | 53 | + `port` [<number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) Port the client should connect to.
+ `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... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
42fd156d-076b-59e1-837a-37b96d98a33d | docs | nodejs | nodejs_tls | 11x | 54 | + `rejectUnauthorized` [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) If not `false`, 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. **Defau... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
115a8633-4cbd-5a11-b21c-3c1af711218a | docs | nodejs | nodejs_tls | 11x | 55 | An array of strings, `Buffer`s or `TypedArray`s or `DataView`s, or a
single `Buffer` or `TypedArray` or `DataView` 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 p... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
c13de582-fc3f-53cc-80ae-4f7756f2e01c | docs | nodejs | nodejs_tls | 11x | 56 | + `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_11x.md |
88bd13c2-3b82-5f4b-9e03-12e7e9f01f93 | docs | nodejs | nodejs_tls | 11x | 57 | **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_11x.md |
1d5b31fc-d1fc-519b-a61c-9993f535deac | docs | nodejs | nodejs_tls | 11x | 58 | * `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_11x.md |
906e5c6b-c7b5-5f98-a506-a7597bbdf5d5 | docs | nodejs | nodejs_tls | 11x | 59 | 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_11x.md |
76f46fc4-a300-5908-821e-05e141a3f407 | docs | nodejs | nodejs_tls | 11x | 60 | * 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_11x.md |
7a6a173f-adef-51b8-a4a2-25638d6c5f66 | docs | nodejs | nodejs_tls | 11x | 61 | * 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_11x.md |
94740e02-572d-5507-8dbf-596897077616 | docs | nodejs | nodejs_tls | 11x | 62 | | v7.3.0 | If the `key` option is an array, individual entries do not need a `passphrase` property anymore. `Array` entries can also just be `string`s or `Buffer`s now. |
| 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>... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
a389bfbd-ad0d-58ca-a0f1-5fb1c3fd162a | docs | nodejs | nodejs_tls | 11x | 63 | strings and/or `Buffer`s. 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
certificates that are not chainable to a well-known CA, the certificate's CA
... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
4ed1d436-be1b-5c30-a7bc-b14184f9e935 | docs | nodejs | nodejs_tls | 11x | 64 | + `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) Cert chains in PEM ... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
3962a3bb-610e-53ee-ad10-90b7468f3237 | docs | nodejs | nodejs_tls | 11x | 65 | + `ciphers` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) Cipher suite specification, replacing the default. For
more information, see [modifying the default cipher suite](#tls_modifying_the_default_tls_cipher_suite). Permitted
ciphers can be obtained via [`tl... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
2baf6ccc-993f-579c-b79a-1bb1568867a3 | docs | nodejs | nodejs_tls | 11x | 66 | + `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_forward_secrecy). Use `openssl dhparam` to create the parameters.
The key len... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
7ee433c1-c3cf-5999-9f40-90a6d7c25e4c | docs | nodejs | nodejs_tls | 11x | 67 | available curve names. On recent releases, `openssl ecparam -list_curves`
will also display the name and description of each available elliptic curve.
**Default:** [`tls.DEFAULT_ECDH_CURVE`](#tls_tls_default_ecdh_curve).
+ `honorCipherOrder` [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScr... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
6f6378c2-7c57-5828-a937-7ad2db1ab2e7 | docs | nodejs | nodejs_tls | 11x | 68 | + `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_11x.md |
52994b66-72bd-5abf-b7fa-b38fa3185508 | docs | nodejs | nodejs_tls | 11x | 69 | + `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.3`, `TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified
along with the `secureProtocol` option, use one or the other.
**Defau... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
2beeb443-06b2-5de9-a68e-38214b659c33 | docs | nodejs | nodejs_tls | 11x | 70 | + `passphrase` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) Shared passphrase used for a single private key and/or
a PFX.
+ `pfx` [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | [<string[]>](https://developer.mo... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
96dda486-b0a3-5536-98e5-eecf0b036249 | docs | nodejs | nodejs_tls | 11x | 71 | occur in an array. `object.passphrase` is optional. Encrypted PFX will be
decrypted with `object.passphrase` if provided, or `options.passphrase` if
it is not.
+ `secureOptions` [<number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) Optionally affect the OpenSSL pr... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
dfdf4103-f964-56fd-afc0-c8824e7e3b1d | docs | nodejs | nodejs_tls | 11x | 72 | [SSL\_METHODS](https://www.openssl.org/docs/man1.1.1/man7/ssl.html#Dealing-with-Protocol-Methods), use the function names as strings. For example, use
`'TLSv1_1_method'` to force TLS version 1.1, or `'TLS_method'` to allow any
TLS protocol version up to TLSv1.3. It is not recommended to use TLS
versions... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
8ab10cc5-bb8e-505f-879a-a0042c2f7b8a | docs | nodejs | nodejs_tls | 11x | 73 | from `process.argv` as the default value of the `sessionIdContext` option, other
APIs that create secure contexts have no default value.
The `tls.createSecureContext()` method creates a `SecureContext` object. It is
usable as an argument to several `tls` APIs, such as [`tls.createServer()`](#tls_tls_createserver_optio... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
71992d3f-e8b4-525d-9793-e8207c8f7c28 | docs | nodejs | nodejs_tls | 11x | 74 | | v8.0.0 | The `ALPNProtocols` option can be a `TypedArray` or `DataView` now. |
| 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/Reference/Global_Objects/Object)
+ `ALPNProtocols`: [<string[]>](https://develope... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
aea0104d-ee0f-50af-8789-1cf259e4ead1 | docs | nodejs | nodejs_tls | 11x | 75 | `Buffer` or `TypedArray` or `DataView` 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, e.g.
`['hello', 'world']`. (... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
696c5e65-a8e3-5dd6-809a-b2e0d0de9062 | docs | nodejs | nodejs_tls | 11x | 76 | + `rejectUnauthorized` [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) If not `false` 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:** `true`.
... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
e999b28e-2655-5b91-875f-8c47cefa7095 | docs | nodejs | nodejs_tls | 11x | 77 | + `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`. `SNICallback` should invoke `cb(null... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
ebb537f1-96a5-530b-b64d-d6b03fab6370 | docs | nodejs | nodejs_tls | 11x | 78 | * `secureConnectionListener` [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)
* Returns: [<tls.Server>](tls.html#tls_class_tls_server)
Creates a new [`tls.Server`](#tls_class_tls_server). The `secureConnectionListener`, if provided, is
automatically set as a liste... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
8b2ca38f-656c-5a11-bfe9-6b6f85b5d09d | docs | nodejs | nodejs_tls | 11x | 79 | socket.authorized ? 'authorized' : 'unauthorized');
socket.write('welcome!\n');
socket.setEncoding('utf8');
socket.pipe(socket);
});
server.listen(8000, () => {
console.log('server bound');
});
```
The server can be tested by connecting to it using the example client from
[`tls.connect()`](#tls_t... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
677efbca-e842-5b33-9ed6-b7270f112cde | docs | nodejs | nodejs_tls | 11x | 80 | ## tls.DEFAULT\_ECDH\_CURVE[#](#tls_tls_default_ecdh_curve)
History
| Version | Changes |
| --- | --- |
| v10.0.0 | Default value changed to `'auto'`. |
| v0.11.13 | Added in: v0.11.13 |
The default curve name to use for ECDH key agreement in a tls server. The
default value is `'auto'`. See [`tls.createSecureContext... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
37b6bd1c-fd84-50e2-ae6a-62079e08ad78 | docs | nodejs | nodejs_tls | 11x | 81 | the default to `'TLSv1.3'`. If multiple of the options are provided, the
highest maximum is used.
## tls.DEFAULT\_MIN\_VERSION[#](#tls_tls_default_min_version)
Added in: v11.4.0
* [<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) The default value of the `minVersion`... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
2132a108-0a32-574a-915b-c4d78d400d5a | docs | nodejs | nodejs_tls | 11x | 82 | ## Deprecated APIs[#](#tls_deprecated_apis)
### Class: CryptoStream[#](#tls_class_cryptostream)
Added in: v0.3.4Deprecated since: v0.11.3
[Stability: 0](documentation.html#documentation_stability_index) - Deprecated: Use [`tls.TLSSocket`](#tls_class_tls_tlssocket) instead.
The `tls.CryptoStream` class represents a ... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
50c46ef3-1aa4-5712-9963-08386bb5e8c2 | docs | nodejs | nodejs_tls | 11x | 83 | Returned by [`tls.createSecurePair()`](#tls_tls_createsecurepair_context_isserver_requestcert_rejectunauthorized_options).
#### 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... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
e64197ba-9fec-5af1-aac6-0c7a22bd99a9 | docs | nodejs | nodejs_tls | 11x | 84 | * `context` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) A secure context object as returned by
`tls.createSecureContext()`
* `isServer` [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) `true` to specify that this ... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
3e686810-0f7c-5dde-80d6-6cee27acc476 | docs | nodejs | nodejs_tls | 11x | 85 | + `isServer`: If `true` the TLS socket will be instantiated in server-mode.
**Default:** `false`.
+ `server` [<net.Server>](net.html#net_class_net_server) A [`net.Server`](net.html#net_class_net_server) instance
+ `requestCert`: See [`tls.createServer()`](#tls_tls_createserver_options_secureconnectionlistener... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
9bf532ea-ee8d-510f-8096-2f6a1ba858a2 | docs | nodejs | nodejs_tls | 11x | 86 | 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
strea... | large_dataset/raw/docs/nodejs/tls/tls_11x.md |
e6a1224c-a5ef-505e-a17e-f22838139c9d | docs | nodejs | nodejs_tls | 4x | 0 | # TLS (SSL)#
Source: https://nodejs.org/docs/latest-v4.x/api/tls.html
Version: 4.x
```None
Stability: 2 - Stable
```
Use `require('tls')` to access this module.
The `tls` module uses OpenSSL to provide Transport Layer Security and/or
Secure Socket Layer: encrypted stream communication.
TLS/SSL is a public/private ... | large_dataset/raw/docs/nodejs/tls/tls_4x.md |
1d04f9d3-e246-56a3-afae-bd1ed20c351d | docs | nodejs | nodejs_tls | 4x | 1 | Alternatively you can send the CSR to a Certificate Authority for signing.
For Perfect Forward Secrecy, it is required to generate Diffie-Hellman
parameters:
```None
openssl dhparam -outform PEM -out dhparam.pem 2048
```
To create .pfx or .p12, do this:
```None
openssl pkcs12 -export -in agent5-cert.pem -inkey agen... | large_dataset/raw/docs/nodejs/tls/tls_4x.md |
460e6242-3109-5ae4-a641-d33a0180413f | docs | nodejs | nodejs_tls | 4x | 2 | error is emitted on the [`tls.TLSSocket`](#tls_class_tls_tlssocket) instance when the threshold is
exceeded. The limits are configurable:
* `tls.CLIENT_RENEG_LIMIT`: renegotiation limit, default is 3.
* `tls.CLIENT_RENEG_WINDOW`: renegotiation window in seconds, default is
10 minutes.
Don't change the defaults unle... | large_dataset/raw/docs/nodejs/tls/tls_4x.md |
3a822f83-2aad-53b4-9335-5c5e3e6de712 | docs | nodejs | nodejs_tls | 4x | 3 | HIGH:
!aNULL:
!eNULL:
!EXPORT:
!DES:
!RC4:
!MD5:
!PSK:
!SRP:
!CAMELLIA
```
This default can be overriden entirely using the `--tls-cipher-list` command
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-S... | large_dataset/raw/docs/nodejs/tls/tls_4x.md |
b4227deb-a6ce-59b2-91fe-2cd0b7dc111d | docs | nodejs | nodejs_tls | 4x | 4 | * SNI - to use one TLS server for multiple hostnames with different SSL
certificates.
## Perfect Forward Secrecy[#](#tls_perfect_forward_secrecy)
The term "[Forward Secrecy](https://en.wikipedia.org/wiki/Perfect_forward_secrecy)" or "Perfect Forward Secrecy" describes a feature of
key-agreement (i.e. key-exchange) ... | large_dataset/raw/docs/nodejs/tls/tls_4x.md |
d7dad4e5-2297-555f-a38d-8475b9be3371 | docs | nodejs | nodejs_tls | 4x | 5 | * [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.org/wiki/Elliptic_curve_Diffie%E2%80%93Hellman) - An ephemeral version of the Elliptic Curve Diffie Hellman
key-agreement protocol.
Ephemeral ... | large_dataset/raw/docs/nodejs/tls/tls_4x.md |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.