Skip to content

x509store: add X509::Store{,Context}#flags and #clear_flags#1067

Open
rhenium wants to merge 1 commit into
ruby:masterfrom
rhenium:ky/x509store-flags-warn-add
Open

x509store: add X509::Store{,Context}#flags and #clear_flags#1067
rhenium wants to merge 1 commit into
ruby:masterfrom
rhenium:ky/x509store-flags-warn-add

Conversation

@rhenium

@rhenium rhenium commented Jun 21, 2026

Copy link
Copy Markdown
Member

OpenSSL::X509::Store{,Context}#flags= does not clear existing flags. Instead, it ORs new flags to the current set. This is contrary to normal convention and likely unintentional, but changing the behavior would not be acceptable for compatibility reasons.

Add #flags to get the current flags to allow users to explicitly express the intention with store.flags |= OpenSSL::X509::V_.... Also, add #clear_flags to remove existing flags. The underlying OpenSSL C APIs appear to have been added in a patch release of OpenSSL 0.9.8.

Warn in #flags= if the argument is not a superset of the existing flags.

OpenSSL::X509::Store{,Context}#flags= does not clear existing flags.
Instead, it ORs new flags to the current set. This is contrary to
normal convention and likely unintentional, but changing the behavior
would not be acceptable for compatibility reasons.

Add #flags to get the current flags to allow users to explicitly express
the intention with "store.flags |= OpenSSL::X509::V_...".
Also, add #clear_flags to remove existing flags. The underlying OpenSSL
C APIs appear to have been added in a patch release of OpenSSL 0.9.8.

Warn in #flags= if the argument is not a superset of the existing flags.
@rhenium rhenium force-pushed the ky/x509store-flags-warn-add branch from ab87f22 to a245620 Compare June 21, 2026 10:44
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