Fix verify_mode() panic on unmodeled verify mode bits#2651
Merged
Conversation
SslContextRef::verify_mode() and SslRef::verify_mode() used from_bits(...).expect(...), which panics if OpenSSL returns verify mode bits not modeled by SslVerifyMode — e.g. SSL_VERIFY_CLIENT_ONCE (0x4) or SSL_VERIFY_POST_HANDSHAKE (0x8), both of which OpenSSL happily accepts via set_verify. - Add SSL_VERIFY_CLIENT_ONCE and SSL_VERIFY_POST_HANDSHAKE to openssl-sys, and corresponding SslVerifyMode::CLIENT_ONCE / POST_HANDSHAKE flags. - Switch the getters to from_bits_retain so unknown bits are preserved rather than panicking. https://claude.ai/code/session_01SpKgNpVDkf7ihjxpZYZ4o3
On BoringSSL and AWS-LC both cfg-gated flag additions compile out, leaving `mode` unmutated, which fails CI under -Dwarnings.
botovq
approved these changes
Jun 8, 2026
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.
SslContextRef::verify_mode() and SslRef::verify_mode() used from_bits(...).expect(...), which panics if OpenSSL returns verify mode bits not modeled by SslVerifyMode — e.g. SSL_VERIFY_CLIENT_ONCE (0x4) or SSL_VERIFY_POST_HANDSHAKE (0x8), both of which OpenSSL happily accepts via set_verify.
https://claude.ai/code/session_01SpKgNpVDkf7ihjxpZYZ4o3