Closed
Description
For HTTP/2 support, srv.TLSConfig should be initialized to the provided listener's TLS Config before calling ServeTLS. If srv.TLSConfig is non-nil and doesn't include the string "h2" in Config.NextProtos, HTTP/2 support is not enabled.
Since ServeTLS gets to create the tls.Listener, it can initialize the TLSConfig fully, and it does. So the second paragraph is wrong. (Probably because it was copied from Serve #23028.)
Also, ListenAndServeTLS doesn't mention H/2 at all, but applies the same rules as ServeTLS.
The rules are pretty messy, probably worth reviewing all [Server.][ListenAnd]Serve[TLS] docs.
See also #22018