Skip to content

doc: clarify that the ctx argument is optional #34097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions doc/api/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -1696,12 +1696,16 @@ 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 must be called synchronously and 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