Skip to content

ssl native_ca_store: always reinit#21902

Closed
icing wants to merge 3 commits into
curl:masterfrom
icing:ss-native-ca-selection
Closed

ssl native_ca_store: always reinit#21902
icing wants to merge 3 commits into
curl:masterfrom
icing:ss-native-ca-selection

Conversation

@icing

@icing icing commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Move SSL options evaluation from setopt to ssl_config_complete stage. Common function for main and proxy.

Use CURLSSLOPT_AUTO_CLIENT_CERT only for matching origin, do not set CURLSSLOPT_AUTO_CLIENT_CERT for DoH transfers.

This avoids native_ca_store getting stuck on TRUE after being set once.

Add bit `native_ca_store_opt` to keep the setting of CURLOPT_(PROXY_)SSL_OPTIONS
and use that to calculate every easy transfer if a native CA store shall be used or
not.

This avoids `native_ca_store` getting stuck on TRUE after being set once.
stage. Common function for main and proxy.

Use CURLSSLOPT_AUTO_CLIENT_CERT only for matching origin, do not
set CURLSSLOPT_AUTO_CLIENT_CERT for DoH transfers.
@icing icing requested a review from bagder June 8, 2026 09:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts how SSL option bitmasks are applied by deferring evaluation from setopt time to the Curl_ssl_easy_config_complete() stage, so per-transfer SSL-derived flags (notably native_ca_store) are consistently reinitialized and don’t persist incorrectly across transfers. It also limits CURLSSLOPT_AUTO_CLIENT_CERT usage to the initial origin and explicitly disables it for DoH internal transfers.

Changes:

  • Move evaluation of CURLOPT_(PROXY_)SSL_OPTIONS-derived flags out of setopt and into Curl_ssl_easy_config_complete().
  • Stop populating per-flag fields in setopt; only store the ssl_options bitmask.
  • Mask out CURLSSLOPT_AUTO_CLIENT_CERT when configuring the internal DoH easy handle.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
lib/vtls/vtls_config.c Adds centralized SSL-options completion logic and applies it during easy-config completion for main and proxy SSL configs.
lib/setopt.c Simplifies SSL options handling to only store the options bitmask (defers derived-flag evaluation).
lib/doh.c Prevents AUTO_CLIENT_CERT from being applied to DoH internal transfers by masking the option bit.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/vtls/vtls_config.c Outdated
@bagder bagder closed this in d69bfad Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants