Skip to content

tls-util: add handshake tests for trust store and client certs - #39428

Merged
jasonhernandez merged 1 commit into
mainfrom
jason/tls-stack-1-openssl-tests
Oct 27, 2026
Merged

jasonhernandez merged 1 commit into
mainfrom
jason/tls-stack-1-openssl-tests

Conversation

@jasonhernandez

@jasonhernandez jasonhernandez commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

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

Pin down the OpenSSL make_tls client behavior with real handshakes
against an in-process OpenSSL server: verify-full with no sslrootcert
trusts a CA installed via SSL_CERT_FILE, and the configured client
certificate is presented to a server that requires one.

Adds tempfile and tokio (both workspace deps) as dev-dependencies.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jasonhernandez
jasonhernandez force-pushed the jason/tls-stack-1-openssl-tests branch from b94323f to 644a36c Compare October 27, 2026 07:09

@antiguru antiguru left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you.

@jasonhernandez
jasonhernandez merged commit 438cff5 into main Oct 27, 2026
84 checks passed
@jasonhernandez
jasonhernandez deleted the jason/tls-stack-1-openssl-tests branch October 27, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants