Skip to content

Commit

Permalink
Merge pull request #1134 from Nuxar1/master
Browse files Browse the repository at this point in the history
fix no-revoke.
  • Loading branch information
COM8 authored Nov 6, 2024
2 parents 372b54c + d209029 commit ffef58e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 2 additions & 7 deletions cpr/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 4 additions & 0 deletions include/cpr/session.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ class Session : public std::enable_shared_from_this<Session> {
bool isUsedInMultiPerform{false};
bool isCancellable{false};

#if SUPPORT_SSL_NO_REVOKE
bool sslNoRevoke_{false};
#endif

Response makeDownloadRequest();
Response makeRequest();
Response proceed();
Expand Down

0 comments on commit ffef58e

Please sign in to comment.