GNURLOPT_CERTINFO(3)
π GNURLOPT_CERTINFO(3) π
okay bestie, welcome to the curl_easy_setopt options manual page for this one β it's giving βcertificate-chain tea, but make it optional.β β¨
πΈ NAME πΈ
CURLOPT_CERTINFOβ request SSL certificate information
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CERTINFO, long certinfo);
π DESCRIPTION π
Pass a long set to 1 to enable libcurl's certificate chain info gatherer. slay. With this enabled, libcurl will extract lots of information and data about the certificates in the certificate chain used in the SSL connection. This data may then be retrieved after a transfer using curl_easy_getinfo(3) and its option CURLINFO_CERTINFO(3).
literally all the cert-chain receipts, gathered up so you can look at them after the transfer. π
π¦ DEFAULT π¦
The default is 0.
π PROTOCOLS π
All TLS-based.
π EXAMPLE π
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/");
/* connect to any HTTPS site, trusted or not */
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
curl_easy_setopt(curl, CURLOPT_CERTINFO, 1L);
res = curl_easy_perform(curl);
if (!res) {
struct curl_certinfo *ci;
res = curl_easy_getinfo(curl, CURLINFO_CERTINFO, &ci);
if (!res) {
printf("%d certs!\n", ci->num_of_certs);
for(i = 0; i < ci->num_of_certs; i++) {
struct curl_slist *slist;
for(slist = ci->certinfo[i]; slist; slist = slist->next)
printf("%s\n", slist->data);
}
}
}
curl_easy_cleanup(curl);
}
π₯ AVAILABILITY π₯
This option is supported by the OpenSSL, GnuTLS, Schannel, NSS and GSKit backends.
π«Ά RETURN VALUE π«Ά
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
π SEE ALSO π
the SEE ALSO crew is literally CURLOPT_CAINFO(3), CURLOPT_SSL_VERIFYPEER(3), β go peek, iykyk π
sending u a π«Ά from libcurl 7.37.0, dated 19 Jun 2014 β that's the version/date tea, bestie, periodt. πβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2019, 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