diff --git a/doc/api/http2.md b/doc/api/http2.md index 28057a58a45724..1d87b5127d9839 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -2275,6 +2275,11 @@ a given number of milliseconds set using `http2secureServer.setTimeout()`. * `socket` {stream.Duplex} @@ -2284,6 +2289,15 @@ negotiate an allowed protocol (i.e. HTTP/2 or HTTP/1.1). The event handler receives the socket for handling. If no listener is registered for this event, the connection is terminated. A timeout may be specified using the `'unknownProtocolTimeout'` option passed to [`http2.createSecureServer()`][]. + +In earlier versions of Node.js, this event would be emitted if `allowHTTP1` is +`false` and, during the TLS handshake, the client either does not send an ALPN +extension or sends an ALPN extension that does not include HTTP/2 (`h2`). Newer +versions of Node.js only emit this event if `allowHTTP1` is `false` and the +client does not send an ALPN extension. If the client sends an ALPN extension +that does not include HTTP/2 (or HTTP/1.1 if `allowHTTP1` is `true`), the TLS +handshake will fail and no secure connection will be established. + See the [Compatibility API][]. #### `server.close([callback])` diff --git a/doc/api/tls.md b/doc/api/tls.md index 1d4db99a11bf22..3477a90faa6e37 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -683,8 +683,8 @@ is set to describe how authorization failed. Depending on the settings of the TLS server, unauthorized connections may still be accepted. The `tlsSocket.alpnProtocol` property is a string that contains the selected -ALPN protocol. When ALPN has no selected protocol, `tlsSocket.alpnProtocol` -equals `false`. +ALPN protocol. When ALPN has no selected protocol because the client or the +server did not send an ALPN extension, `tlsSocket.alpnProtocol` equals `false`. The `tlsSocket.servername` property is a string containing the server name requested via SNI. @@ -2012,6 +2012,11 @@ where `secureSocket` has the same API as `pair.cleartext`.