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 <ryzokuken@disroot.org>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
lpinca authored and MylesBorins committed Jul 16, 2020
1 parent 1558800 commit 6aa0dac
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions doc/api/tls.md
Expand Up @@ -1704,12 +1704,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 6aa0dac

Please sign in to comment.