Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
doc, tls: deprecate createSecurePair
createSecurePair uses tls_legacy and the legacy Connection from
node_crypto.cc. Deprecate them in favor of TLSSocket.
  • Loading branch information
jhamhader committed Apr 25, 2016
commit b8b0a81a83941eb6bf3449d4403c5347a2203d2b
21 changes: 19 additions & 2 deletions doc/api/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ the total bytes written to the socket, *including the TLS overhead*.

## Class: SecurePair

Stability: 0 - Deprecated: Use [`tls.TLSSocket`][] instead.

Returned by tls.createSecurePair.

### Event: 'secure'
Expand Down Expand Up @@ -379,9 +381,9 @@ Construct a new TLSSocket object from an existing TCP socket.

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

- `requestCert`: Optional, see [`tls.createSecurePair()`][]
- `requestCert`: Optional, see [`tls.createServer()`][]

- `rejectUnauthorized`: Optional, see [`tls.createSecurePair()`][]
- `rejectUnauthorized`: Optional, see [`tls.createServer()`][]

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

Expand Down Expand Up @@ -745,6 +747,8 @@ publicly trusted list of CAs as given in

## tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized][, options])

Stability: 0 - Deprecated: Use [`tls.TLSSocket`][] instead.

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
Expand All @@ -770,6 +774,19 @@ stream.

NOTE: `cleartext` has the same API as [`tls.TLSSocket`][]

**Deprecated** `tls.createSecurePair()` is now deprecated in favor of
`tls.TLSSocket()`. For example:
```
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style nit, can you add the js to the end of the three backticks and put a blank line before the examples

pair = tls.createSecurePair( ... );
pair.encrypted.pipe(socket);
socket.pipe(pair.encrypted);
```
can be replaced with:
```
secure_socket = tls.TLSSocket(socket, options);
```
where `secure_socket` has the same API as `pair.cleartext`.

## tls.createServer(options[, secureConnectionListener])

Creates a new [tls.Server][]. The `connectionListener` argument is
Expand Down