Closed rossbrin closed 3 years ago
This is already possible. Here is an example:
SslOptions sslOpts = Ssl(ssl::NoRevoke{true});
Response response = cpr::Get(url, sslOpts, Verbose{});
Thanks for the reply. This (useful) feature was added to cpr two months ago and appeared in the 1.6.0 release last month. Vcpkg supports cpr 1.5.2 at this time, so I presume we must await for somebody within Microsoft to update vcpkg from cpr 1.5.2 to cpr 1.6.0.
Exactly. But anybody can submit a PR for vcpkg, updating packages.
FWIW it would be really great if vcpkg could be updated to 1.6.2 - I gave it a quick try earlier but it seems the CMake files have changed quite a bit and I couldn't quite figure out what was going wrong so I moved on for now.
Does cpr support any way to disable checking the certificate revocation list during an SSL negotiation? I'm on Windows 64, using Visual Studio 2019, with cpr version 1.5.2, libcurl v 7.74.0#4, and civetweb 1.13#1 as https host. cpr is installed on my machine using vcpkg which produces a x64-windows-static library. curl/libcurl are installed using vcpkg with the [schannel,tool] options specified.
The development box (softloft.localhost) running the https host has its own site certificate, there's a loopback in the hosts file to redirect softloft.localhost to 127.0.0.1 and the CA which signed the site certificate is stored in the windows certificate repository. Inside a browser, the page loads correctly. Command-line curl loads the page correctly with the following invocation:
curl -v https://softloft.local:443/example --ssl-no-revoke
libcurl supports the commandline
--ssl-no-revoke
flag via a call tocurl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NO_REVOKE)
. However, cpr does not supportCURLSSLOPT_NO_REVOKE
which means that, unless SSL is disabled altogether by usingcpr::VerifySsl(false)
, SSL verification will fail because there is no CRL set up.Suggestion: , cpr could add
curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NO_REVOKE)
as a new one-line function in session.cpp/hpp.