libcpr / cpr

C++ Requests: Curl for People, a spiritual port of Python Requests.
https://docs.libcpr.org/
Other
6.59k stars 937 forks source link

Potential SSL Windows no revoke fix #889

Closed COM8 closed 1 year ago

COM8 commented 1 year ago

Fixes #861

huytc commented 7 months ago

Hello @COM8 , I don't think this fixes the issue.

These changes made in this commit

#if SUPPORT_SSL_NO_REVOKE
    // NOLINTNEXTLINE (google-runtime-int)
    long bitmask{0};
    curl_easy_setopt(curl_->handle, CURLOPT_SSL_OPTIONS, &bitmask);
    const bool noRevoke = bitmask & CURLSSLOPT_NO_REVOKE;
#endif

does not store the currently applied CURLOPT_SSL_OPTIONS into bitmask, but instead set CURLOPT_SSL_OPTIONS to the address of the bitmask variable.

Sadly, from my understanding, libcurl's easy interface doesn't seem to provide a curl_easy_setopt method, so the only viable approach here is to store the SslOptions provided in SetSslOptions into a class variable, build a bitmask for the request, and finally call curl_easy_setopt(curl_->handle, CURLOPT_SSL_OPTIONS, bitmask) only once at the end.