GNURLINFO_...RIFYRESULT(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’… 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:

  • 0 is 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_OK if the option is supported πŸ’–
  • and CURLE_UNKNOWN_OPTION if 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