CURLINFO_SSL_VERIFYRESULT(3)
π CURLINFO_SSL_VERIFYRESULT(3) π
okay so bestie, welcome to the CURLINFO_SSL_VERIFYRESULT page β it's from the Library Functions Manual and it's literally all about peeking at the result of your certificate verification π
β¨ NAME β¨
CURLINFO_SSL_VERIFYRESULT β the result of the certificate verification π
Like, the actual verdict on whether that server's SSL cert passed the vibe check or not.
πΈ SYNOPSIS πΈ
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SSL_VERIFYRESULT,
long *result);
π¦ DESCRIPTION π¦
So here's the tea β β you pass in a pointer to a long, and it gets filled with the result of the server SSL certificate verification that you asked for in the first place (you did that with the CURLOPT_SSL_VERIFYPEER(3) option, iykyk).
0 is a positive result. Non-zero is an error. That's it, that's the whole mood π
Translation: zero = your cert is slaying, non-zero = something's sus π
π PROTOCOLS π
This functionality affects, like, all the TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. β¨
Heads up bestie π«Ά β this option works only with the following TLS backends: GnuTLS and OpenSSL. If you're on a different backend, this is not the function for you, no cap π
π EXAMPLE π
okay, a full little demo, enjoy π§
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
long verifyresult;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
result = curl_easy_perform(curl);
if(result) {
printf("error: %s\n", curl_easy_strerror(result));
curl_easy_cleanup(curl);
return 1;
}
result = curl_easy_getinfo(curl, CURLINFO_SSL_VERIFYRESULT,
&verifyresult);
if(!result) {
printf("The peer verification said %s\n",
(verifyresult ? "bad" : "fine"));
}
curl_easy_cleanup(curl);
}
}
See how it prints "bad" or "fine"? That's the whole entire point, and it ate π₯
β AVAILABILITY β
Added in curl 7.5. vintage but iconic, honestly π
π RETURN VALUE π
curl_easy_getinfo(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK, non-zero means an error occurred β go check libcurl-errors(3) for the deets π
π SEE ALSO π
mwah, that's the page π«Ά brought to you by libcurl, dated 2026-10-12 β stay verified and stay iconic, bestie πβ¨π
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms