Alternative services client support#5841
Merged
Merged
Conversation
7f0a04c to
42bbd0e
Compare
67ffd2a to
e9a7edc
Compare
…ns parsing code specifc to RFC3986 production rules.
…ed content matches IPv6address or IPvFuture production rules. Motivation: The HostAndPort IP-literal parser attempts to find content between square brackets, it should ensure that the enclosed content matches production rule. Changes: Implement IPv6address and IPvFuture parsing and use it when parsing IP-literal.
Motivation: Implement Alt-Svc ABNF production parsing into a proper AltSvc object representing the parsed string. This is required to implement alternative services.
Motivation: The HTTP client request protocol is selected by the HttpClientOptions. With the advent of alternative services we should support specifying the protocol per request instead since a server might indicate an alternative server for a given protocol. Changes: HttpConnectOptions is added a protocol property that defines the desired protocol for the request, which is by default null, when null the client default protocol is used. HTTP protocol is added to the client pool key so we distinguish a connection by its desired version, allowing the client to maintain connections to a given server for different versions of the protocol.
…e unwrap which is more efficient
…e alternative set too often.
tsegismont
added a commit
to tsegismont/vertx-sql-client
that referenced
this pull request
Jan 8, 2026
Follows-up on eclipse-vertx/vert.x#5841 io.vertx.core.internal.net.SslChannelProvider.createClientSslHandler changed signature Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
tsegismont
added a commit
to eclipse-vertx/vertx-sql-client
that referenced
this pull request
Jan 8, 2026
Follows-up on eclipse-vertx/vert.x#5841 io.vertx.core.internal.net.SslChannelProvider.createClientSslHandler changed signature Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
tsegismont
added a commit
to tsegismont/vertx-web
that referenced
this pull request
Jan 8, 2026
Follows-up on eclipse-vertx/vert.x#5841 FakeEndpointResolver moved to FakeAddressResolver New methods declared in HttpClientInternal Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
tsegismont
added a commit
to vert-x3/vertx-web
that referenced
this pull request
Jan 8, 2026
Follows-up on eclipse-vertx/vert.x#5841 FakeEndpointResolver moved to FakeAddressResolver New methods declared in HttpClientInternal Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation of client HTTP Alternative Services (RFC 7838)
Implementation is based on the HTTP client address resolver which provides already client service discovery. Alternative services can be considered as a discovery mechanism that is populated by the interactions the client has with servers.
Origin resolver
The
OriginResolverresolvesOriginaddress to anOriginEndpoint.An origin is the triplet (scheme,host,port) described by The Web Origin Concept.
An
OriginEndpointmaintainsOriginServerresulting from DNS resolution and for which we cannot really make an assumption on the HTTP protocol it can handle (although it is TCP based).OriginServeralternatives for which the HTTP protocol is determined by the alternative services discoveryThe initial resolution uses the classic A/AAAA DNS resolution and thus initially an origin endpoint is the list of DNS resolved socket addresses.
When the client considers a connection could send alt-svc events, it sets an alt-svc event handler on the connection and relays those events to the origin resolver: an origin endpoint is looked up and when the endpoint is found, it is updated with the alternative services and potentially considered stale.
When an origin endpoint is stale, the resolver updates it on the next resolver lookup and we use the DNS resolver to obtain the alternative services adresses and keep only the ones we can DNS resolve.
Address resolver modifications
Several modifications have been made to the address resolver.
An endpoint is now capable of maintaining a filtered view of the server, which allows to create views for a given protocol and perform load balancing on this view.
HTTP modifications
The HTTP client relies on the origin resolver to obtain an origin endpoint. When the request
The
HttpConnectOptionsnow has aprotocolVersionfield that allows to set a desired HTTP version of the protocol instead of the version defined byHttpClientOptions.A new
HttpProtocolenum has been added to describe more precisely the HTTP protocol used as defined by https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids .TLS changes
The
SslContextManagerandSslContextProviderhave been updated to cache ssl contexts with the application protocols it supports. When a request is made to resolve an ssl context, the list of application protocols is passed instead of using an initial list provided at build time of the resolver.Parser
A bunch of parsers have been added to parse alt-svc header strings.
DNS load balancing
The internal resolver for load balancing with DNS A/AAAA records is merged into the new origin resolver since this is pretty much the same thing.
Further work: SVCB and HTTPS Resource Records
The implementation of SVCB and HTTPS Resource Records will piggy back on this PR when the DNS resolver will support it. The origin resolver will obtain HTTPS resource records and directly populate the alternative services for a given origin.