Skip to content

doc: add tls.convertALPNProtocols(protocols, out) #58026

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
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
17 changes: 17 additions & 0 deletions doc/api/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -2332,6 +2332,23 @@ may include certificates loaded from the system store (if `--use-system-ca` is u
or loaded from a file indicated by `NODE_EXTRA_CA_CERTS`, use
[`tls.getCACertificates()`][].

## `tls.convertALPNProtocols(protocols, out)`

<!-- YAML
added: v6.0.0
-->

* `protocols`: {string\[]|Buffer\[]|TypedArray\[]|DataView\[]|Buffer|
TypedArray|DataView}
An array of strings, `Buffer`s, `TypedArray`s, or `DataView`s, or a
single `Buffer`, `TypedArray`, or `DataView` containing the supported ALPN
protocols. `Buffer`s should have the format `[len][name][len][name]...`
e.g. `'\x08http/1.1\x08http/1.0'`, where the `len` byte is the length of the
next protocol name. Passing an array is usually much simpler, e.g.
`['http/1.1', 'http/1.0']`. Protocols earlier in the list have higher
preference than those later.
* `out` {Object} A output variable supplied by users, in which the converted `protocols` result `out.ALPNProtocols`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `out` {Object} A output variable supplied by users, in which the converted `protocols` result `out.ALPNProtocols`.
* `out` {Object} An output variable supplied by users. The converted `protocols` result is assigned to `out.ALPNProtocols`.


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is usually a section documenting the function after the prototype documentation. That needs to be added if we want to document this function as a part of our public API.

## `tls.DEFAULT_ECDH_CURVE`

<!-- YAML
Expand Down
Loading