@@ -168,6 +168,8 @@ the total bytes written to the socket, *including the TLS overhead*.
168
168
169
169
## Class: SecurePair
170
170
171
+ Stability: 0 - Deprecated: Use [`tls.TLSSocket`][] instead.
172
+
171
173
Returned by tls.createSecurePair.
172
174
173
175
### Event: 'secure'
@@ -379,9 +381,9 @@ Construct a new TLSSocket object from an existing TCP socket.
379
381
380
382
- ` server ` : An optional [ ` net.Server ` ] [ ] instance
381
383
382
- - ` requestCert ` : Optional, see [ ` tls.createSecurePair () ` ] [ ]
384
+ - ` requestCert ` : Optional, see [ ` tls.createServer () ` ] [ ]
383
385
384
- - ` rejectUnauthorized ` : Optional, see [ ` tls.createSecurePair () ` ] [ ]
386
+ - ` rejectUnauthorized ` : Optional, see [ ` tls.createServer () ` ] [ ]
385
387
386
388
- ` NPNProtocols ` : Optional, see [ ` tls.createServer() ` ] [ ]
387
389
@@ -745,6 +747,8 @@ publicly trusted list of CAs as given in
745
747
746
748
## tls.createSecurePair([ context] [ , isServer ] [ , requestCert] [ , rejectUnauthorized ] [ , options] )
747
749
750
+ Stability: 0 - Deprecated: Use [`tls.TLSSocket`][] instead.
751
+
748
752
Creates a new secure pair object with two streams, one of which reads and writes
749
753
the encrypted data and the other of which reads and writes the cleartext data.
750
754
Generally, the encrypted stream is piped to/from an incoming encrypted data
@@ -770,6 +774,23 @@ stream.
770
774
771
775
NOTE: ` cleartext ` has the same API as [ ` tls.TLSSocket ` ] [ ]
772
776
777
+ ** Deprecated** ` tls.createSecurePair() ` is now deprecated in favor of
778
+ ` tls.TLSSocket() ` . For example:
779
+
780
+ ``` js
781
+ pair = tls .createSecurePair ( ... );
782
+ pair .encrypted .pipe (socket);
783
+ socket .pipe (pair .encrypted );
784
+ ```
785
+
786
+ can be replaced with:
787
+
788
+ ``` js
789
+ secure_socket = tls .TLSSocket (socket, options);
790
+ ```
791
+
792
+ where ` secure_socket ` has the same API as ` pair.cleartext ` .
793
+
773
794
## tls.createServer(options[ , secureConnectionListener] )
774
795
775
796
Creates a new [ tls.Server] [ ] . The ` connectionListener ` argument is
0 commit comments