crypto: fix crash on invalid mTLS certs in CREATE/ALTER CONNECTION#35894
Merged
jasonhernandez merged 1 commit intomainfrom Apr 10, 2026
Merged
crypto: fix crash on invalid mTLS certs in CREATE/ALTER CONNECTION#35894jasonhernandez merged 1 commit intomainfrom
jasonhernandez merged 1 commit intomainfrom
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
|
66a24e8 to
c648256
Compare
This was referenced Apr 7, 2026
c648256 to
8690248
Compare
mtabebe
approved these changes
Apr 8, 2026
8690248 to
c9b5171
Compare
The CSR HTTP client builder could panic on invalid TLS configuration (e.g., malformed certificates) because it used `.unwrap()` on the reqwest builder. Replace with `.map_err()` to surface the error. Wrap CREATE CONNECTION and ALTER CONNECTION validation tasks in `ore_catch_unwind` so that panics in TLS handshakes don't crash the coordinator — they now return an AdapterError instead. Add test verifying that invalid TLS material (garbage PKCS#12, PEM, DER) is rejected at construction time with an error. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
c9b5171 to
dae2ed7
Compare
def-
reviewed
Apr 17, 2026
| Err(_panic) => { | ||
| tracing::error!("connection validation panicked"); | ||
| Err(AdapterError::Internal( | ||
| "connection validation panicked".into(), |
Contributor
There was a problem hiding this comment.
We should really keep the panic message available somewhere instead of just silencing it entirely, otherwise how can we debug it?
| Err(_panic) => { | ||
| tracing::error!("alter connection validation panicked"); | ||
| Err(AdapterError::Internal( | ||
| "connection validation panicked".into(), |
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
.unwrap()→.map_err()on reqwest builder)CREATE CONNECTION ... VALIDATEandALTER CONNECTION ... VALIDATEtasks inore_catch_unwindso TLS handshake panics returnAdapterErrorinstead of crashing the coordinatorMotivation
When a user runs
CREATE CONNECTIONorALTER CONNECTIONwith malformed mTLS certificates (e.g., corrupt PEM, invalid PKCS#12), the connection validation task panics and takes down the coordinator. After this fix, those cases return a user-facing error instead.Test plan
test_invalid_tls_config_returns_error— garbage PKCS#12/PEM/DER rejected with errorkafka-authschema-registry mTLS tests pass🤖 Generated with Claude Code