Skip to content

Commit 14b8e5a

Browse files
committed
tls: remove tls_legacy, createSecurePair
This is a semver-major change. Remove SecurePair, createSecure pair from API. Remove internal Connection class and SecurePair tests.
1 parent a15906c commit 14b8e5a

14 files changed

Lines changed: 131 additions & 2161 deletions

doc/api/tls.markdown

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -166,19 +166,6 @@ This is an encrypted stream.
166166
A proxy to the underlying socket's bytesWritten accessor, this will return
167167
the total bytes written to the socket, *including the TLS overhead*.
168168

169-
## Class: SecurePair
170-
171-
Returned by tls.createSecurePair.
172-
173-
### Event: 'secure'
174-
175-
This event is emitted from the SecurePair once the pair has successfully
176-
established a secure connection.
177-
178-
As with checking for the server [`secureConnection`](#event-secureconnection)
179-
event, `pair.cleartext.authorized` should be inspected to confirm whether the
180-
certificate used is properly authorized.
181-
182169
## Class: tls.Server
183170

184171
This class is a subclass of `net.Server` and has the same methods on it.
@@ -379,9 +366,9 @@ Construct a new TLSSocket object from an existing TCP socket.
379366

380367
- `server`: An optional [`net.Server`][] instance
381368

382-
- `requestCert`: Optional, see [`tls.createSecurePair()`][]
369+
- `requestCert`: Optional, see [`tls.createServer()`][]
383370

384-
- `rejectUnauthorized`: Optional, see [`tls.createSecurePair()`][]
371+
- `rejectUnauthorized`: Optional, see [`tls.createServer()`][]
385372

386373
- `NPNProtocols`: Optional, see [`tls.createServer()`][]
387374

@@ -743,33 +730,6 @@ If no 'CA' details are given, then Node.js will use the default
743730
publicly trusted list of CAs as given in
744731
<http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt>.
745732

746-
## tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized][, options])
747-
748-
Creates a new secure pair object with two streams, one of which reads and writes
749-
the encrypted data and the other of which reads and writes the cleartext data.
750-
Generally, the encrypted stream is piped to/from an incoming encrypted data
751-
stream and the cleartext one is used as a replacement for the initial encrypted
752-
stream.
753-
754-
- `credentials`: A secure context object from `tls.createSecureContext( ... )`.
755-
756-
- `isServer`: A boolean indicating whether this TLS connection should be
757-
opened as a server or a client.
758-
759-
- `requestCert`: A boolean indicating whether a server should request a
760-
certificate from a connecting client. Only applies to server connections.
761-
762-
- `rejectUnauthorized`: A boolean indicating whether a server should
763-
automatically reject clients with invalid certificates. Only applies to
764-
servers with `requestCert` enabled.
765-
766-
- `options`: An object with common SSL options. See [`tls.TLSSocket`][].
767-
768-
`tls.createSecurePair()` returns a SecurePair object with `cleartext` and
769-
`encrypted` stream properties.
770-
771-
NOTE: `cleartext` has the same API as [`tls.TLSSocket`][]
772-
773733
## tls.createServer(options[, secureConnectionListener])
774734

775735
Creates a new [tls.Server][]. The `connectionListener` argument is
@@ -983,7 +943,6 @@ console.log(ciphers); // ['AES128-SHA', 'AES256-SHA', ...]
983943
[BEAST attacks]: https://blog.ivanristic.com/2011/10/mitigating-the-beast-attack-on-tls.html
984944
[`crypto.getCurves()`]: crypto.html#crypto_crypto_getcurves
985945
[`tls.createServer()`]: #tls_tls_createserver_options_secureconnectionlistener
986-
[`tls.createSecurePair()`]: #tls_tls_createsecurepair_context_isserver_requestcert_rejectunauthorized_options
987946
[`tls.TLSSocket`]: #tls_class_tls_tlssocket
988947
[`net.Server`]: net.html#net_class_net_server
989948
[`net.Socket`]: net.html#net_class_net_socket

0 commit comments

Comments
 (0)