Fix HTTP/2 downstream server certificate always null#1145
Merged
shivamgupta1 merged 3 commits intolinkedin:masterfrom Feb 24, 2026
Merged
Fix HTTP/2 downstream server certificate always null#1145shivamgupta1 merged 3 commits intolinkedin:masterfrom
shivamgupta1 merged 3 commits intolinkedin:masterfrom
Conversation
In HTTP/2, the channel pool hands out child stream channels whose attribute maps are separate from the parent TCP channel. The server certificate is stored on the parent by CertificateHandler, so child streams always read null. Resolve the parent channel when reading SERVER_CERTIFICATES so the cert is found for both HTTP/1.1 and HTTP/2.
Read server certificate from the current channel first (HTTP/1.1), falling back to the parent channel if not found (HTTP/2 streams). This is backward compatible for HTTP/1.1 and fixes cert resolution for HTTP/2 multiplexed stream channels. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
li-bsoetarman
approved these changes
Feb 19, 2026
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.
Summary
CertificateHandlerstores the cert on the parent TCP channel, but the channel pool hands out child stream channels with separate attribute mapsSERVER_CERTIFICATESfrom the current channel first (HTTP/1.1), then fall back to the parent channel if not found (HTTP/2 child streams)Context on
getSslTimingCallbackSslHandshakeTimingHandlerserves two separate concerns:handlerAdded()and runs once per TCP connection.getSslTimingCallback(static method) — a utility that wraps aTransportCallbackand is called per-stream/per-request (e.g. inHttp2NettyStreamClient). Its job is to transfer already-computed channel-level attributes (handshake duration, server certificate) into each request'sRequestContext.In HTTP/2, the
channelpassed to this callback is a child stream channel, but the certificate is set on the parent TCP channel byCertificateHandler. This is why the fix adds a parent-channel fallback lookup — the child stream channel will never have theSERVER_CERTIFICATESattribute set directly on it.Testing Done
TestSslHandshakeTimingHandler)