1
- ## TLS (SSL)
1
+ # TLS (SSL)
2
2
3
3
Use ` require('tls') ` to access this module.
4
4
@@ -26,7 +26,9 @@ Alternatively you can send the CSR to a Certificate Authority for signing.
26
26
(TODO: docs on creating a CA, for now interested users should just look at
27
27
` test/fixtures/keys/Makefile ` in the Node source code)
28
28
29
- ### Client-initiated renegotiation attack mitigation
29
+ ## Client-initiated renegotiation attack mitigation
30
+
31
+ <!-- type=misc -->
30
32
31
33
The TLS protocol lets the client renegotiate certain aspects of the TLS session.
32
34
Unfortunately, session renegotiation requires a disproportional amount of
@@ -49,7 +51,9 @@ and tap `R<CR>` (that's the letter `R` followed by a carriage return) a few
49
51
times.
50
52
51
53
52
- ### NPN and SNI
54
+ ## NPN and SNI
55
+
56
+ <!-- type=misc -->
53
57
54
58
NPN (Next Protocol Negotiation) and SNI (Server Name Indication) are TLS
55
59
handshake extensions allowing you:
@@ -138,8 +142,8 @@ You can test this server by connecting to it with `openssl s_client`:
138
142
openssl s_client -connect 127.0.0.1:8000
139
143
140
144
141
- #### tls.connect(options, [ secureConnectListener] )
142
- #### tls.connect(port, [ host] , [ options] , [ secureConnectListener] )
145
+ ## tls.connect(options, [ secureConnectListener] )
146
+ ## tls.connect(port, [ host] , [ options] , [ secureConnectListener] )
143
147
144
148
Creates a new client connection to the given ` port ` and ` host ` (old API) or
145
149
` options.port ` and ` options.host ` . (If ` host ` is omitted, it defaults to
@@ -232,6 +236,10 @@ and the cleartext one is used as a replacement for the initial encrypted stream.
232
236
` tls.createSecurePair() ` returns a SecurePair object with
233
237
[ cleartext] ( #tls.CleartextStream ) and ` encrypted ` stream properties.
234
238
239
+ ## Class: SecurePair
240
+
241
+ Returned by tls.createSecurePair.
242
+
235
243
### Event: 'secure'
236
244
237
245
The event is emitted from the SecurePair once the pair has successfully
@@ -241,7 +249,7 @@ Similarly to the checking for the server 'secureConnection' event,
241
249
pair.cleartext.authorized should be checked to confirm whether the certificate
242
250
used properly authorized.
243
251
244
- ## tls.Server
252
+ ## Class: tls.Server
245
253
246
254
This class is a subclass of ` net.Server ` and has the same methods on it.
247
255
Instead of accepting just raw TCP connections, this accepts encrypted
@@ -315,17 +323,17 @@ gets high.
315
323
The number of concurrent connections on the server.
316
324
317
325
318
- ## tls.CleartextStream
326
+ ## Class: tls.CleartextStream
319
327
320
328
This is a stream on top of the * Encrypted* stream that makes it possible to
321
329
read/write an encrypted data as a cleartext data.
322
330
323
331
This instance implements a duplex [ Stream] ( streams.html#streams ) interfaces.
324
332
It has all the common stream methods and events.
325
333
326
- ### Event: 'secureConnect'
334
+ A ClearTextStream is the ` clear ` member of a SecurePair object.
327
335
328
- ` function () {} `
336
+ ### Event: 'secureConnect'
329
337
330
338
This event is emitted after a new connection has been successfully handshaked.
331
339
The listener will be called no matter if the server's certificate was
0 commit comments