CURLOPT_CRLFILE.3 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. .\" generated by cd2nroff 0.1 from CURLOPT_CRLFILE.md
  2. .TH CURLOPT_CRLFILE 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_CRLFILE \- Certificate Revocation List file
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CRLFILE, char *file);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass a char pointer to a null\-terminated string naming a \fIfile\fP with the
  12. concatenation of CRL (in PEM format) to use in the certificate validation that
  13. occurs during the SSL exchange.
  14. When curl is built to use GnuTLS, there is no way to influence the use of CRL
  15. passed to help in the verification process.
  16. When libcurl is built with OpenSSL support, X509_V_FLAG_CRL_CHECK and
  17. X509_V_FLAG_CRL_CHECK_ALL are both set, requiring CRL check against all the
  18. elements of the certificate chain if a CRL file is passed. Also note that
  19. \fICURLOPT_CRLFILE(3)\fP implies \fBCURLSSLOPT_NO_PARTIALCHAIN\fP (see
  20. \fICURLOPT_SSL_OPTIONS(3)\fP) since curl 7.71.0 due to an OpenSSL bug.
  21. This option makes sense only when used in combination with the
  22. \fICURLOPT_SSL_VERIFYPEER(3)\fP option.
  23. A specific error code (\fICURLE_SSL_CRL_BADFILE\fP) is defined with the option. It
  24. is returned when the SSL exchange fails because the CRL file cannot be
  25. loaded. A failure in certificate verification due to a revocation information
  26. found in the CRL does not trigger this specific error.
  27. The application does not have to keep the string around after setting this
  28. option.
  29. .SH DEFAULT
  30. NULL
  31. .SH PROTOCOLS
  32. This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
  33. This option works only with the following TLS backends:
  34. GnuTLS, OpenSSL and mbedTLS
  35. .SH EXAMPLE
  36. .nf
  37. int main(void)
  38. {
  39. CURL *curl = curl_easy_init();
  40. if(curl) {
  41. CURLcode res;
  42. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  43. curl_easy_setopt(curl, CURLOPT_CRLFILE, "/etc/certs/crl.pem");
  44. res = curl_easy_perform(curl);
  45. curl_easy_cleanup(curl);
  46. }
  47. }
  48. .fi
  49. .SH AVAILABILITY
  50. Added in curl 7.19.0
  51. .SH RETURN VALUE
  52. Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
  53. CURLE_OUT_OF_MEMORY if there was insufficient heap space.
  54. .SH SEE ALSO
  55. .BR CURLOPT_PROXY_CRLFILE (3),
  56. .BR CURLOPT_SSL_VERIFYHOST (3),
  57. .BR CURLOPT_SSL_VERIFYPEER (3)