Skip to content

setopt: return CURLE_NOT_BUILT_IN for unsupported SSL options#20364

Closed
Frank-Buss wants to merge 3 commits intocurl:masterfrom
Frank-Buss:frankbuss/setopt-bugfix
Closed

setopt: return CURLE_NOT_BUILT_IN for unsupported SSL options#20364
Frank-Buss wants to merge 3 commits intocurl:masterfrom
Frank-Buss:frankbuss/setopt-bugfix

Conversation

@Frank-Buss
Copy link
Contributor

The SSL options CURLOPT_ISSUERCERT, CURLOPT_SSL_EC_CURVES, and CURLOPT_CRLFILE were silently accepted by curl_easy_setopt() even when the SSL backend doesn't support them. This could mislead applications into believing security features are active when they're not.

This PR adds Curl_ssl_supports() checks for these options, consistent with how other SSL options like CURLOPT_PINNEDPUBLICKEY and CURLOPT_SSL_SIGNATURE_ALGORITHMS are already handled.

Tested with mbedTLS and OpenSSL backends. After this change, unsupported options return CURLE_NOT_BUILT_IN instead of silently succeeding.

@Frank-Buss
Copy link
Contributor Author

Right, logically we should probably add another flag for it, I added a new commit.

@bagder bagder closed this in d7bbc78 Jan 20, 2026
@bagder
Copy link
Member

bagder commented Jan 20, 2026

Thanks!

charles2910 added a commit to charles2910/pycurl that referenced this pull request Feb 26, 2026
CURLOPT_ISSUERCERT_BLOB is only available with the openssl backend [1],
but up until 8.19.0-rc1 it would not fail the test. After d7bbc783601
was merged [2], it started to report correctly options that were not
supported by the backend libcurl was built with.

[1] https://curl.se/libcurl/c/CURLOPT_ISSUERCERT_BLOB.html
[2] curl/curl#20364
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants