Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c9b35b9

Browse files
committed
doc refactor: tls
1 parent c4d6c7f commit c9b35b9

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

doc/api/tls.markdown

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## TLS (SSL)
1+
# TLS (SSL)
22

33
Use `require('tls')` to access this module.
44

@@ -26,7 +26,9 @@ Alternatively you can send the CSR to a Certificate Authority for signing.
2626
(TODO: docs on creating a CA, for now interested users should just look at
2727
`test/fixtures/keys/Makefile` in the Node source code)
2828

29-
### Client-initiated renegotiation attack mitigation
29+
## Client-initiated renegotiation attack mitigation
30+
31+
<!-- type=misc -->
3032

3133
The TLS protocol lets the client renegotiate certain aspects of the TLS session.
3234
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
4951
times.
5052

5153

52-
### NPN and SNI
54+
## NPN and SNI
55+
56+
<!-- type=misc -->
5357

5458
NPN (Next Protocol Negotiation) and SNI (Server Name Indication) are TLS
5559
handshake extensions allowing you:
@@ -138,8 +142,8 @@ You can test this server by connecting to it with `openssl s_client`:
138142
openssl s_client -connect 127.0.0.1:8000
139143

140144

141-
#### tls.connect(options, [secureConnectListener])
142-
#### tls.connect(port, [host], [options], [secureConnectListener])
145+
## tls.connect(options, [secureConnectListener])
146+
## tls.connect(port, [host], [options], [secureConnectListener])
143147

144148
Creates a new client connection to the given `port` and `host` (old API) or
145149
`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.
232236
`tls.createSecurePair()` returns a SecurePair object with
233237
[cleartext](#tls.CleartextStream) and `encrypted` stream properties.
234238

239+
## Class: SecurePair
240+
241+
Returned by tls.createSecurePair.
242+
235243
### Event: 'secure'
236244

237245
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,
241249
pair.cleartext.authorized should be checked to confirm whether the certificate
242250
used properly authorized.
243251

244-
## tls.Server
252+
## Class: tls.Server
245253

246254
This class is a subclass of `net.Server` and has the same methods on it.
247255
Instead of accepting just raw TCP connections, this accepts encrypted
@@ -315,17 +323,17 @@ gets high.
315323
The number of concurrent connections on the server.
316324

317325

318-
## tls.CleartextStream
326+
## Class: tls.CleartextStream
319327

320328
This is a stream on top of the *Encrypted* stream that makes it possible to
321329
read/write an encrypted data as a cleartext data.
322330

323331
This instance implements a duplex [Stream](streams.html#streams) interfaces.
324332
It has all the common stream methods and events.
325333

326-
### Event: 'secureConnect'
334+
A ClearTextStream is the `clear` member of a SecurePair object.
327335

328-
`function () {}`
336+
### Event: 'secureConnect'
329337

330338
This event is emitted after a new connection has been successfully handshaked.
331339
The listener will be called no matter if the server's certificate was

0 commit comments

Comments
 (0)