Skip to content

setopt: clear the "custom" CA booleans when set to NULL#21901

Closed
bagder wants to merge 2 commits into
masterfrom
bagder/custom-paths
Closed

setopt: clear the "custom" CA booleans when set to NULL#21901
bagder wants to merge 2 commits into
masterfrom
bagder/custom-paths

Conversation

@bagder

@bagder bagder commented Jun 8, 2026

Copy link
Copy Markdown
Member

Mark them as custom choices only when pointer is passed, and clear them again when set to NULL.

Mark them as custom choices only when pointer is passed, and clear them
again when set to NULL.
@bagder bagder requested a review from icing June 8, 2026 07:30
@bagder bagder added the TLS label Jun 8, 2026
@bagder bagder marked this pull request as ready for review June 8, 2026 07:34
@bagder bagder requested a review from Copilot June 8, 2026 07:42

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 libcurl tracks whether CA bundle/path/blob settings are “custom” by setting the custom_* booleans based on whether a non-NULL pointer/blob is provided, and clearing those flags again when the option is set to NULL. This matters because these flags influence later default CA / native store configuration decisions in the TLS setup logic.

Changes:

  • Update CURLOPT_CAINFO / CURLOPT_PROXY_CAINFO to set custom_cafile based on whether ptr is non-NULL.
  • Update CURLOPT_CAPATH / CURLOPT_PROXY_CAPATH to set custom_capath based on whether ptr is non-NULL.
  • Update CURLOPT_CAINFO_BLOB / CURLOPT_PROXY_CAINFO_BLOB to set custom_cablob based on whether blob is non-NULL.

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

Comment thread lib/setopt.c Outdated
Comment thread lib/setopt.c Outdated
Comment thread lib/setopt.c Outdated
Comment thread lib/setopt.c Outdated
Comment thread lib/setopt.c Outdated
Comment thread lib/setopt.c Outdated
better

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@icing

icing commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

I think this does not address the problem. Let me have a stab at it.

Update: proposing #21902

@bagder

bagder commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

@icing right, but still it seems to be correct to reset these booleans when we set these options back to NULL, right?

@icing

icing commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@icing right, but still it seems to be correct to reset these booleans when we set these options back to NULL, right?

Yes, indeed.

@bagder bagder closed this in 5df33ef Jun 8, 2026
@bagder bagder deleted the bagder/custom-paths branch June 8, 2026 10:38
dkarpov1970 pushed a commit to dkarpov1970/curl that referenced this pull request Jun 9, 2026
Mark them as custom choices only when pointer is passed, and clear them
again when set to NULL.

Closes curl#21901
dkarpov1970 pushed a commit to dkarpov1970/curl that referenced this pull request Jun 10, 2026
Mark them as custom choices only when pointer is passed, and clear them
again when set to NULL.

Closes curl#21901
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants