Skip to content

ci: nightly TLS check against a public CA endpoint - #39432

Draft
jasonhernandez wants to merge 1 commit into
jason/tls-stack-2-rustls-connectorfrom
jason/tls-stack-4-nightly-public-ca
Draft

jasonhernandez wants to merge 1 commit into
jason/tls-stack-2-rustls-connectorfrom
jason/tls-stack-4-nightly-public-ca

Conversation

@jasonhernandez

@jasonhernandez jasonhernandez commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Part 4 of the TLS migration stack replacing #36085. Stack: #39428 → #39430 → #39431 and #39432 (both based on #39430).

The unit tests use private CAs only. Nothing checks that the connectors validate a real, publicly issued chain from the system trust store.

Description

  • Add external_public_ca_endpoint. It completes a verify-full handshake with s3.amazonaws.com through both make_tls_rustls and make_tls. It returns early unless MZ_TLS_UTIL_TEST_EXTERNAL_CAS is set, so PR CI skips it.
  • The vendored OpenSSL looks up default roots under /usr/local/ssl, which doesn't exist at runtime. So the OpenSSL leg points SSL_CERT_FILE at the system bundle that openssl-probe finds. The dev-dependency is already in the workspace.
  • Add a --tls-external flag to the cargo-test composition that starts no services.
  • Add a cargo-test-tls-external Nightly step. It uses ci-builder: stable for the Rust toolchain, the composition's topics and one automatic retry for network flakes.

Verification

Ran locally with the env var set, and the test passes. Without SSL_CERT_FILE, the OpenSSL leg fails as described above. The pipeline topics lint passes.

🤖 Generated with Claude Code

@jasonhernandez
jasonhernandez force-pushed the jason/tls-stack-2-rustls-connector branch from 0f0a2dc to 95855dc Compare October 27, 2026 07:09
@jasonhernandez
jasonhernandez force-pushed the jason/tls-stack-4-nightly-public-ca branch from 29f1b0c to 7d02854 Compare October 27, 2026 07:09
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
jasonhernandez force-pushed the jason/tls-stack-2-rustls-connector branch from 95855dc to 0017751 Compare October 28, 2026 00:32
Add `external_public_ca_endpoint`, which completes a verify-full
handshake with s3.amazonaws.com through both `make_tls_rustls` and
`make_tls`, checking that each validates a publicly issued chain from
the system trust store. It needs external network access, so it returns
early unless MZ_TLS_UTIL_TEST_EXTERNAL_CAS is set.

The vendored openssl's default verify paths point at its build-time
OPENSSLDIR, which does not exist at runtime, so the openssl leg points
SSL_CERT_FILE at the system bundle found by openssl-probe.

The new `cargo-test-tls-external` Nightly step runs it through the
cargo-test composition's `--tls-external` flag, which starts no
services.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jasonhernandez
jasonhernandez force-pushed the jason/tls-stack-4-nightly-public-ca branch from 7d02854 to 08ca149 Compare October 28, 2026 05:53

This branch has not been deployed

No deployments
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.

1 participant