Repository navigation
Pass the peer address to the TCP TLS client engine - #16590
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 3.3 #16590 +/- ##
============================================
+ Coverage 61.15% 61.17% +0.01%
+ Complexity 11768 15 -11753
============================================
Files 1953 1953
Lines 89354 89359 +5
Branches 13487 13487
============================================
+ Hits 54646 54666 +20
+ Misses 29088 29070 -18
- Partials 5620 5623 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
EarthChen
left a comment
There was a problem hiding this comment.
Verified on 3.3 @ 7c4a075 (which already includes #16200): the TCP path still
creates the client SSLEngine without a peer host, so a trusted certificate with
a matching SAN fails the handshake. Running this PR's regression test on that
base commit gives 2 failures (acceptsMatchingSubjectAlternativeName, both
NettyClient and NettyConnectionClient, SSLHandshakeException: certificate_unknown);
with the PR applied all 4 tests pass. #16200 only fixed the QUIC/HTTP3 engine,
so this fix for the TCP clients is still needed.
The fix matches the approach merged in #16200 (pass the peer host at engine
creation) and I found no other uncovered newEngine call sites. Minor notes,
non-blocking: the rejectsMismatched cases on the unpatched base also "pass" but
for the wrong reason (undefined peer host rather than SAN mismatch), and the
legacy SslClientTlsHandler(URL) constructor path is not covered by the new
test. Also consider rebasing onto the current 3.3 tip before merge.
3f4d726 to
402ee0f
Compare
Assert the peer host and port and inspect the client's handshake failure for a certificate SAN mismatch. Delay the server handshake until the client handler has been captured, so a failed handshake cannot race with channel lookup. Add coverage for the URL and context-only SslClientTlsHandler constructors. Fixes apache#16589
What is the purpose of the change?
Fixes #16589.
Pass the connection address to the client TLS engine. This lets Netty’s default hostname verification check the server certificate instead of failing with an undefined peer host.
Add real TLS handshake regressions for both TCP clients, covering matching and mismatched SANs. The related QUIC change is #16200.
Checks: 6 targeted tests pass; module Checkstyle and Spotless pass.
Checklist