tls-util: migrate mz-tls-util from openssl to rustls#35838
Draft
jasonhernandez wants to merge 1 commit intoMaterializeInc:jason/sec-219-tls-test-infrafrom
Draft
tls-util: migrate mz-tls-util from openssl to rustls#35838jasonhernandez wants to merge 1 commit intoMaterializeInc:jason/sec-219-tls-test-infrafrom
jasonhernandez wants to merge 1 commit intoMaterializeInc:jason/sec-219-tls-test-infrafrom
Conversation
Contributor
|
Thanks for opening this PR! Here are a few tips to help make the review process smooth for everyone. PR title guidelines
Pre-merge checklist
|
ff190e3 to
268990f
Compare
Rewrite the central TLS utility crate to use rustls instead of openssl: - make_tls: returns MakeRustlsConnect (rustls-based) instead of postgres-openssl MakeTlsConnector. Supports SslMode verification, client certificates, and a NoVerifier for non-verifying modes. - pkcs12der_from_pem: validates PEM with rustls-pki-types instead of openssl. Stores concatenated PEM in the Pkcs12Archive for backward compatibility (consumers use reqwest::Identity::from_pem). - TlsError: OpenSsl variant replaced with Rustls variant. - MakeRustlsConnect + RustlsConnect: implements tokio_postgres MakeTlsConnect trait using tokio-rustls, with RustlsTlsStream wrapper for TlsStream trait. Updated consumers: - mz-postgres-util: removed openssl + postgres-openssl deps, updated error types - mz-postgres-client: updated TlsError match arm - mz-debug: replaced MakeTlsConnector/TlsStream with rustls equivalents - mz-ccsr: pkcs12der_from_pem error type changed (already updated in SEC-220) - mz-storage-types: pkcs12der_from_pem returns anyhow::Error (compatible) Part of SEC-192. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
268990f to
5c1142c
Compare
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
Migrate
mz-tls-util— the central client-side TLS abstraction — fromopenssl/postgres-openssltorustls/tokio-postgres-rustlswithaws-lc-rsas the crypto backend.make_tls()now returnsMakeRustlsConnectusingrustls::ClientConfigconfigured viamz_ore::crypto::fips_crypto_provider(), with appropriate cert verification for each SSL mode (VerifyFull, VerifyCa via customCaOnlyVerifier, NoVerify for Disable/Prefer/Require-no-CA)TlsError::OpenSslreplaced withTlsError::Rustlspkcs12der_from_pem()removed from mz-tls-util; inlined into ccsr and storage-types which still need PKCS#12 for their downstream TLS libraries (reqwest native-tls, mysql_async)PostgresSsl(openssl::error::ErrorStack)variant, removed openssl + postgres-openssl depsMakeRustlsConnect, refactored connection setupDependencies
This PR is based on
jason/sec-219-tls-test-infrawhich includes prerequisite PRs:Works toward SEC-192.
Test plan
cargo check -p mz-tls-util— compiles cleanlycargo check -p mz-ccsr— compiles cleanlycargo check -p mz-testdrive— compiles cleanlycargo check -p mz-storage-types— compiles cleanlycargo check -p mz-postgres-util --features tunnel— compiles cleanlycargo clippy -p mz-tls-util— no warningscargo fmt— cleanChecklist
🤖 Generated with Claude Code