summaryrefslogtreecommitdiff
path: root/doc/api/tls.md
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2017-12-11 04:37:47 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2017-12-12 12:46:21 -0200
commit93656f4366bcb6084cae63aeb97a63d3634bac2b (patch)
tree2e78c87c6aa9b55f2ac4a0045692038654d024f3 /doc/api/tls.md
parentdd2200ecf831cae5f57b69e3ee8a934efbe20af8 (diff)
downloadandroid-node-v8-93656f4366bcb6084cae63aeb97a63d3634bac2b.tar.gz
android-node-v8-93656f4366bcb6084cae63aeb97a63d3634bac2b.tar.bz2
android-node-v8-93656f4366bcb6084cae63aeb97a63d3634bac2b.zip
doc,test: mention Duplex support for TLS
Document and test the existing support for generic Duplex streams in the TLS module. PR-URL: https://github.com/nodejs/node/pull/17599 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'doc/api/tls.md')
-rw-r--r--doc/api/tls.md15
1 files changed, 10 insertions, 5 deletions
diff --git a/doc/api/tls.md b/doc/api/tls.md
index 38e35fb5d2..13af0b2aa2 100644
--- a/doc/api/tls.md
+++ b/doc/api/tls.md
@@ -455,7 +455,10 @@ changes:
description: ALPN options are supported now.
-->
-* `socket` {net.Socket} An instance of [`net.Socket`][]
+* `socket` {net.Socket|stream.Duplex}
+ On the server side, any `Duplex` stream. On the client side, any
+ instance of [`net.Socket`][] (for generic `Duplex` stream support
+ on the client side, [`tls.connect()`][] must be used).
* `options` {Object}
* `isServer`: The SSL/TLS protocol is asymmetrical, TLSSockets must know if
they are to behave as a server or a client. If `true` the TLS socket will be
@@ -815,10 +818,12 @@ changes:
* `port` {number} Port the client should connect to.
* `path` {string} Creates unix socket connection to path. If this option is
specified, `host` and `port` are ignored.
- * `socket` {net.Socket} Establish secure connection on a given socket rather
- than creating a new socket. If this option is specified, `path`, `host` and
- `port` are ignored. Usually, a socket is already connected when passed to
- `tls.connect()`, but it can be connected later. Note that
+ * `socket` {stream.Duplex} Establish secure connection on a given socket
+ rather than creating a new socket. Typically, this is an instance of
+ [`net.Socket`][], but any `Duplex` stream is allowed.
+ If this option is specified, `path`, `host` and `port` are ignored,
+ except for certificate validation. Usually, a socket is already connected
+ when passed to `tls.connect()`, but it can be connected later. Note that
connection/disconnection/destruction of `socket` is the user's
responsibility, calling `tls.connect()` will not cause `net.connect()` to be
called.