GNURLOPT_SSL_VERIFYSTATUS(3)

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

okay so bestie, this is the GNURLOPT_SSL_VERIFYSTATUS(3) page from the curl_easy_setopt options crew β€” and it's here to explain how to make libcurl check the server cert's status. πŸ’…βœ¨

πŸŽ€ NAME πŸŽ€

CURLOPT_SSL_VERIFYSTATUS β€” verify the certificate's status. πŸ‘‘

✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_VERIFYSTATUS, long
verify);

πŸ’– DESCRIPTION πŸ’–

You pass a long as the parameter: set it to 1 to enable this, or 0 to disable it. Simple. 🫢

This option decides whether libcurl verifies the status of the server cert using the "Certificate Status Request" TLS extension (aka. OCSP stapling). It's giving security main character energy. πŸ”₯

⚠️ note: if this option is enabled but the server does not support the TLS extension, the verification will fail. no cap, it will not just shrug and move on. 😭

🌸 DEFAULT 🌸

0

πŸ¦‹ PROTOCOLS πŸ¦‹

All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. ✨

πŸŽ€ EXAMPLE πŸŽ€

CURL *curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  /* ask for OCSP stapling! */
  curl_easy_setopt(curl, CURLOPT_SSL_VERIFYSTATUS, 1L);
  ret = curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}

πŸ’œ AVAILABILITY πŸ’œ

Added in 7.41.0. This option is currently only supported by the OpenSSL, GnuTLS and NSS TLS backends. 🧚

🌈 RETURN VALUE 🌈

Returns CURLE_OK if OCSP stapling is supported by the SSL backend, otherwise returns CURLE_NOT_BUILT_IN. πŸ’…

⭐ SEE ALSO ⭐


⭐ that's the whole page, bestie. it's libcurl 7.40.0, dated 04 Dec 2014, and the manual page is GNURLOPT_SSL_VERIFYSTATUS(3). slay πŸ’–

πŸ“¦ where this page comes from