Skip to content
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

doc: clarify that the ctx argument is optional #34097

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 10 additions & 6 deletions doc/api/tls.md
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
jasnell marked this conversation as resolved.
Show resolved Hide resolved
`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