GNURLINFO_...RIFYRESULT(3)
π CURLINFO_SSL_VERIFYRESULT β get the result of the certificate verification π
okay bestie, welcome to the curl_easy_getinfo options corner of the manual, specifically the socket-family page for CURLINFO_SSL_VERIFYRESULT. yes the header up top is being dramatic and truncated, it's giving "my name is a mystery" energy, but we move π
β¨ NAME β¨
CURLINFO_SSL_VERIFYRESULT β get the result of the certificate verification π
like, the actual vibe check the library did on the server's certificate. no cap.
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_SSL_VERIFYRESULT, long *result);
that's it. that's the whole summoning ritual π«Ά
β¨ DESCRIPTION β¨
so here's the tea β β you pass a pointer to a long, and it gets filled with the result of the server SSL certificate verification that was requested (requested how? via the CURLOPT_SSL_VERIFYPEER(3) option, bestie, keep up π
).
and the scoring system is iconic:
0is a positive result. slay. the cert passed. π- Non-zero is an error. not slay. π
that's the whole bit β zero good, not-zero bad. the numbers have main character energy and honestly? respect.
β¨ PROTOCOLS β¨
All using TLS π
(every protocol that rides with TLS is in the club. if it's not on TLS, it's not invited.)
β¨ EXAMPLE β¨
here's how you'd actually use it, copy-paste-obligatory:
CURL *curl = curl_easy_init();
if(curl) {
CURLcode res;
long verifyresult;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
res = curl_easy_perform(curl);
curl_easy_getinfo(curl, CURLINFO_SSL_VERIFYRESULT, &verifyresult);
printf("The peer verification said %s\n", verifyresult?
"BAAAD":"fine");
curl_easy_cleanup(curl);
}
the "BAAAD" with three A's is canon and I will not be taking questions π literally the most honest error message in the whole library.
β¨ AVAILABILITY β¨
- Added in
7.5. vintage. a classic. π - Only set by the OpenSSL/libressl/boringssl, NSS and GnuTLS backends.
β οΈ ngl, if you're on some other backend, this one's not going to be set for you. the backends listed above are the only ones who set it. don't come for me, that's just the rule π
β¨ RETURN VALUE β¨
- Returns
CURLE_OKif the option is supported π - and
CURLE_UNKNOWN_OPTIONif not π
that's the whole spectrum. two outcomes. binary queen.
β¨ SEE ALSO β¨
go read those next, they're the parent friend group of this whole operation π¦
okay that's the page!! you understood all of it, I'm so proud of you, go verify some certificates responsibly πΈβ¨
libcurl 7.44.0 Β· 1 Sep 2015 β yeah this documentation is a lil vintage, from back when 1 Sep 2015 was the moment, but it's still iconic and it still ate π
π
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms