1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_PROXY_CRLFILE
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_PROXY_SSL_VERIFYHOST (3)
9  - CURLOPT_PROXY_SSL_VERIFYPEER (3)
10  - CURLOPT_SSL_VERIFYHOST (3)
11  - CURLOPT_SSL_VERIFYPEER (3)
12Protocol:
13  - TLS
14TLS-backend:
15  - GnuTLS
16  - mbedTLS
17  - OpenSSL
18---
19
20# NAME
21
22CURLOPT_PROXY_CRLFILE - HTTPS proxy Certificate Revocation List file
23
24# SYNOPSIS
25
26~~~c
27#include <curl/curl.h>
28
29CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_CRLFILE, char *file);
30~~~
31
32# DESCRIPTION
33
34This option is for connecting to an HTTPS proxy, not an HTTPS server.
35
36Pass a char pointer to a null-terminated string naming a *file* with the
37concatenation of CRL (in PEM format) to use in the certificate validation that
38occurs during the SSL exchange.
39
40When curl is built to use GnuTLS, there is no way to influence the use of CRL
41passed to help in the verification process. When libcurl is built with OpenSSL
42support, X509_V_FLAG_CRL_CHECK and X509_V_FLAG_CRL_CHECK_ALL are both set,
43requiring CRL check against all the elements of the certificate chain if a CRL
44file is passed.
45
46This option makes sense only when used in combination with the
47CURLOPT_PROXY_SSL_VERIFYPEER(3) option.
48
49A specific error code (*CURLE_SSL_CRL_BADFILE*) is defined with the option. It
50is returned when the SSL exchange fails because the CRL file cannot be loaded.
51A failure in certificate verification due to a revocation information found in
52the CRL does not trigger this specific error.
53
54The application does not have to keep the string around after setting this
55option.
56
57# DEFAULT
58
59NULL
60
61# EXAMPLE
62
63~~~c
64int main(void)
65{
66  CURL *curl = curl_easy_init();
67  if(curl) {
68    CURLcode res;
69    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
70    curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:80");
71    curl_easy_setopt(curl, CURLOPT_PROXY_CRLFILE, "/etc/certs/crl.pem");
72    res = curl_easy_perform(curl);
73    curl_easy_cleanup(curl);
74  }
75}
76~~~
77
78# AVAILABILITY
79
80Added in 7.52.0
81
82# RETURN VALUE
83
84Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
85CURLE_OUT_OF_MEMORY if there was insufficient heap space.
86