You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
net.http: add ALPN negotiation to the Windows SChannel backend (#27395)
* net.http: add ALPN negotiation to the Windows SChannel backend
First half of #27383: give the SChannel (vschannel) TLS backend the
ability to advertise ALPN protocols and read the protocol the server selected,
reaching parity with the mbedtls/OpenSSL backends (#27343) on the negotiation
primitive.
thirdparty/vschannel/vschannel.c:
- TlsContext gains an ALPN protocol list to advertise and a slot for the
negotiated protocol.
- perform_client_handshake() passes a SECBUFFER_APPLICATION_PROTOCOLS input
buffer (SEC_APPLICATION_PROTOCOLS / SecApplicationProtocolNegotiationExt_ALPN)
into the ClientHello when a list is configured; the path is unchanged when it
is not, so existing HTTP/1.1 requests are byte-identical.
- After the handshake, SECPKG_ATTR_APPLICATION_PROTOCOL is queried and stored.
- New C entry points: vschannel_set_alpn(), vschannel_get_alpn(), and
vschannel_alpn_probe() (handshake-only, no application data).
vlib/net/http (Windows only):
- vschannel_alpn_windows.c.v exposes the C API, an alpn_wire() encoder, and
schannel_alpn_probe().
- vschannel_alpn_windows_test.v: a wire-encoding unit test plus `-d network`
tests that probe a public HTTP/2 server and assert `h2` is negotiated (and
that offering only http/1.1 falls back).
This deliberately does NOT change fetch(): the one-shot vschannel request() path
still speaks HTTP/1.1, so advertising `h2` in real requests waits for the
HTTP/2-driver wiring (the second half of #27383). It satisfies the issue's
first acceptance criterion (a negotiated_alpn()-equivalent on SChannel).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* thirdparty/vschannel: add ALPN type shim for older SDK headers (tcc)
tcc bundles Windows SDK headers that predate SChannel ALPN, so the ALPN structs, enums and constants were undeclared. Define them when the SDK headers do not, matching the official layout exactly.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Richard Wheeler <quaesitor.scientiam@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Alexander Medvednikov <alexander@medvednikov.com>
0 commit comments