From eb1564f814256e15640dc5fa5494a82753a3b876 Mon Sep 17 00:00:00 2001 From: Jimmy Leung <43258070+hkleungai@users.noreply.github.com> Date: Sat, 26 Apr 2025 00:58:40 +0800 Subject: [PATCH] doc: add tls.convertALPNProtocols(protocols, out) Add convertALPNProtocols() to doc/api/tls.md, since the source code actually exposes this method. Refs: https://github.com/nodejs/node/commit/802a2e7 --- doc/api/tls.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/doc/api/tls.md b/doc/api/tls.md index 7e443fb66e5021..ff157a3573946c 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -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)` + + + +* `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`. + ## `tls.DEFAULT_ECDH_CURVE`