Repository navigation
tls-util: support tls-server-end-point channel binding for rustls - #39431
Draft
jasonhernandez wants to merge 1 commit into
Draft
jasonhernandez wants to merge 1 commit into
jasonhernandez wants to merge 1 commit into
Conversation
This was referenced Sep 30, 2026
This was referenced Oct 25, 2026
jasonhernandez
force-pushed
the
jason/tls-stack-2-rustls-connector
branch
from
October 27, 2026 07:09
0f0a2dc to
95855dc
Compare
jasonhernandez
force-pushed
the
jason/tls-stack-3-channel-binding
branch
from
October 27, 2026 07:09
0558f48 to
c6dd533
Compare
jasonhernandez
added a commit
that referenced
this pull request
Oct 27, 2026
### Motivation First PR in the TLS migration stack replacing #36085: #39428 (this, OpenSSL handshake tests) → #39430 (rustls Postgres connector) → #39431 (channel binding) and #39432 (nightly public-CA check). #39433 (pgwire-common `TlsStream` bridge) is independent, based on main. These tests pin down today's OpenSSL TLS client behavior in `mz-tls-util` ahead of the rustls migration, which will extend each test with a rustls leg. Split out of #36085. ### Description - `verify_full_trusts_default_store`: with `sslmode=verify-full` and no `sslrootcert`, `make_tls` trusts a CA from the default store (`SSL_CERT_FILE`). - `client_certs_accepted`: `make_tls` presents the configured client certificate to a server that requires one. - Harness: a throwaway `TestCa`, a blocking OpenSSL `SslAcceptor` server on a background thread, and connect/assert helpers. - `tempfile` and `tokio` added as dev-dependencies (both existing workspace deps). No production code changes. ### Verification Ran the tests repeatedly under nextest. Confirmed each fails when its property is broken (no `SSL_CERT_FILE`, no client cert). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Jason Hernandez <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
jasonhernandez
force-pushed
the
jason/tls-stack-2-rustls-connector
branch
from
October 28, 2026 00:32
95855dc to
0017751
Compare
`RustlsTlsStream::channel_binding` now reports the RFC 5929 tls-server-end-point binding of the server's leaf certificate, so connections through `make_tls_rustls` can authenticate with SCRAM-SHA-256-PLUS like the openssl connector. The certificate is hashed with its signature algorithm's hash function, MD5 and SHA-1 upgraded to SHA-256. Algorithms without a single hash function, such as Ed25519, report no binding, as openssl does. Tests compare the binding against openssl's certificate digest for RSA and ECDSA certificates across hash functions, and check that Ed25519 and unparseable certificates yield none. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jasonhernandez
force-pushed
the
jason/tls-stack-3-channel-binding
branch
from
October 28, 2026 05:53
c6dd533 to
843bc92
Compare
This branch has not been deployed
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.
Motivation
Part 3 of the TLS migration stack replacing #36085. Stack: #39428 → #39430 → #39431 and #39432 (both based on #39430).
Without channel binding, connections through
make_tls_rustlscannot use SCRAM-SHA-256-PLUS, which the OpenSSL connector supports.Description
tls_server_end_point, the RFC 5929tls-server-end-pointdigest. It hashes the leaf certificate with its signature algorithm's hash, upgrades MD5 and SHA-1 to SHA-256, and returnsNonefor algorithms without a single hash, such as Ed25519 and RSASSA-PSS. OpenSSL behaves the same way.RustlsTlsStream::channel_bindingnow returns the digest.x509-certand hashes withsha2. This adds three newCargo.lockentries:x509-cert, plusder_deriveandflagset, which it pulls in.der,spkiandconst-oidare already locked.Verification
tls_server_end_point_digestscompares the digest with OpenSSL's certificate digest for RSA signed with SHA-224/256/384/512 and SHA-1, and for ECDSA signed with SHA-256/384. It also checks that Ed25519 returnsNone.tls_server_end_point_rejects_garbagecovers unparseable input.🤖 Generated with Claude Code