diff --git a/doc/api/tls.md b/doc/api/tls.md index 34f09b052ec56e..f3c103373d6430 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -376,8 +376,8 @@ more information. added: v0.3.2 --> -* `callback` {Function} An optional listener callback that will be registered to - listen for the server instance's `'close'` event. +* `callback` {Function} A listener callback that will be registered to listen +for the server instance's `'close'` event. The `server.close()` method stops the server from accepting new connections. @@ -458,24 +458,24 @@ changes: * `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 instantiated as a server. **Default:** `false`. - * `server` {net.Server} An optional [`net.Server`][] instance. + * `server` {net.Server} A [`net.Server`][] instance. * `requestCert`: Whether to authenticate the remote peer by requesting a certificate. Clients always request a server certificate. Servers - (`isServer` is true) may optionally set `requestCert` to true to request a - client certificate. - * `rejectUnauthorized`: Optional, see [`tls.createServer()`][] - * `ALPNProtocols`: Optional, see [`tls.createServer()`][] - * `SNICallback`: Optional, see [`tls.createServer()`][] - * `session` {Buffer} An optional `Buffer` instance containing a TLS session. + (`isServer` is true) may set `requestCert` to true to request a client + certificate. + * `rejectUnauthorized`: See [`tls.createServer()`][] + * `ALPNProtocols`: See [`tls.createServer()`][] + * `SNICallback`: See [`tls.createServer()`][] + * `session` {Buffer} A `Buffer` instance containing a TLS session. * `requestOCSP` {boolean} If `true`, specifies that the OCSP status request extension will be added to the client hello and an `'OCSPResponse'` event will be emitted on the socket before establishing a secure communication - * `secureContext`: Optional TLS context object created with + * `secureContext`: TLS context object created with [`tls.createSecureContext()`][]. If a `secureContext` is _not_ provided, one will be created by passing the entire `options` object to `tls.createSecureContext()`. - * ...: Optional [`tls.createSecureContext()`][] options that are used if the - `secureContext` option is missing, otherwise they are ignored. + * ...: [`tls.createSecureContext()`][] options that are used if the + `secureContext` option is missing. Otherwise, they are ignored. Construct a new `tls.TLSSocket` object from an existing TCP socket. @@ -905,13 +905,13 @@ changes: TLS connection. When a server offers a DH parameter with a size less than `minDHSize`, the TLS connection is destroyed and an error is thrown. **Default:** `1024`. - * `secureContext`: Optional TLS context object created with + * `secureContext`: TLS context object created with [`tls.createSecureContext()`][]. If a `secureContext` is _not_ provided, one will be created by passing the entire `options` object to `tls.createSecureContext()`. * `lookup`: {Function} Custom lookup function. **Default:** [`dns.lookup()`][]. - * ...: Optional [`tls.createSecureContext()`][] options that are used if the + * ...: [`tls.createSecureContext()`][] options that are used if the `secureContext` option is missing, otherwise they are ignored. * `callback` {Function} @@ -995,7 +995,7 @@ added: v0.11.3 --> * `port` {number} Default value for `options.port`. -* `host` {string} Optional default value for `options.host`. +* `host` {string} Default value for `options.host`. * `options` {Object} See [`tls.connect()`][]. * `callback` {Function} See [`tls.connect()`][]. @@ -1005,7 +1005,7 @@ as arguments instead of options. A port or host option, if specified, will take precedence over any port or host argument. -## tls.createSecureContext(options) +## tls.createSecureContext([options])