setopt: clear the "custom" CA booleans when set to NULL#21901
Conversation
Mark them as custom choices only when pointer is passed, and clear them again when set to NULL.
There was a problem hiding this comment.
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_CAINFOto setcustom_cafilebased on whetherptris non-NULL. - Update
CURLOPT_CAPATH/CURLOPT_PROXY_CAPATHto setcustom_capathbased on whetherptris non-NULL. - Update
CURLOPT_CAINFO_BLOB/CURLOPT_PROXY_CAINFO_BLOBto setcustom_cablobbased on whetherblobis non-NULL.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
better Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
I think this does not address the problem. Let me have a stab at it. Update: proposing #21902 |
|
@icing right, but still it seems to be correct to reset these booleans when we set these options back to NULL, right? |
Yes, indeed. |
Mark them as custom choices only when pointer is passed, and clear them again when set to NULL. Closes curl#21901
Mark them as custom choices only when pointer is passed, and clear them again when set to NULL. Closes curl#21901
Mark them as custom choices only when pointer is passed, and clear them again when set to NULL.