Skip to content

Commit

Permalink
doc: clarify that the ctx argument is optional
Browse files Browse the repository at this point in the history
Clarify that the `ctx` argument of the `SNICallback` callback is
optional.

Fixes: #34085

PR-URL: #34097
Reviewed-By: Ujjwal Sharma <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
lpinca authored and jasnell committed Jul 3, 2020
1 parent d3d4ace commit d2c8b3e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions doc/api/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -1696,12 +1696,15 @@ changes:
* `sessionTimeout` {number} The number of seconds after which a TLS session
created by the server will no longer be resumable. See
[Session Resumption][] for more information. **Default:** `300`.
* `SNICallback(servername, cb)` {Function} A function that will be called if
the client supports SNI TLS extension. Two arguments will be passed when
called: `servername` and `cb`. `SNICallback` should invoke `cb(null, ctx)`,
where `ctx` is a `SecureContext` instance. (`tls.createSecureContext(...)`
can be used to get a proper `SecureContext`.) If `SNICallback` wasn't
provided the default callback with high-level API will be used (see below).
* `SNICallback(servername, callback)` {Function} A function that will be
called if the client supports SNI TLS extension. Two arguments will be
passed when called: `servername` and `callback`. `callback` is an
error-first callback that takes two optional arguments: `error` and `ctx`.
`ctx`, if provided, is a `SecureContext` instance.
[`tls.createSecureContext()`][] can be used to get a proper `SecureContext`.
If `callback` is called with a falsy `ctx` argument, the default secure
context of the server will be used. If `SNICallback` wasn't provided the
default callback with high-level API will be used (see below).
* `ticketKeys`: {Buffer} 48-bytes of cryptographically strong pseudo-random
data. See [Session Resumption][] for more information.
* `pskCallback` {Function}
Expand Down

0 comments on commit d2c8b3e

Please sign in to comment.