diff --git a/cpr/session.cpp b/cpr/session.cpp index b2263ec4b..4c16c47ee 100644 --- a/cpr/session.cpp +++ b/cpr/session.cpp @@ -194,12 +194,6 @@ void Session::prepareCommonShared() { #endif #if LIBCURL_VERSION_NUM >= 0x071900 // 7.25.0 -#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 #if LIBCURL_VERSION_NUM >= 0x074700 // 7.71.0 // Fix loading certs from Windows cert store when using OpenSSL: @@ -208,7 +202,7 @@ void Session::prepareCommonShared() { // Ensure SSL no revoke is still set #if SUPPORT_SSL_NO_REVOKE - if (noRevoke) { + if (sslNoRevoke_) { curl_easy_setopt(curl_->handle, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NO_REVOKE); } #endif @@ -530,6 +524,7 @@ void Session::SetSslOptions(const SslOptions& options) { // Ignore here since this has been defined by libcurl. maxTlsVersion); #if SUPPORT_SSL_NO_REVOKE + sslNoRevoke_ = options.ssl_no_revoke; if (options.ssl_no_revoke) { curl_easy_setopt(curl_->handle, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NO_REVOKE); } diff --git a/include/cpr/session.h b/include/cpr/session.h index df1324707..9a69d35aa 100644 --- a/include/cpr/session.h +++ b/include/cpr/session.h @@ -271,6 +271,10 @@ class Session : public std::enable_shared_from_this { bool isUsedInMultiPerform{false}; bool isCancellable{false}; +#if SUPPORT_SSL_NO_REVOKE + bool sslNoRevoke_{false}; +#endif + Response makeDownloadRequest(); Response makeRequest(); Response proceed();