CURLOPT_PROXY_CAINFO.3 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .\"
  25. .TH CURLOPT_PROXY_CAINFO 3 "January 02, 2023" "libcurl 7.88.1" "curl_easy_setopt options"
  26. .SH NAME
  27. CURLOPT_PROXY_CAINFO \- path to proxy Certificate Authority (CA) bundle
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_CAINFO, char *path);
  32. .fi
  33. .SH DESCRIPTION
  34. This option is for connecting to an HTTPS proxy, not an HTTPS server.
  35. Pass a char * to a null-terminated string naming a file holding one or more
  36. certificates to verify the HTTPS proxy with.
  37. If \fICURLOPT_PROXY_SSL_VERIFYPEER(3)\fP is zero and you avoid verifying the
  38. server's certificate, \fICURLOPT_PROXY_CAINFO(3)\fP need not even indicate an
  39. accessible file.
  40. This option is by default set to the system path where libcurl's CA
  41. certificate bundle is assumed to be stored, as established at build time.
  42. If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module
  43. (libnsspem.so) needs to be available for this option to work properly.
  44. (iOS and macOS only) If curl is built against Secure Transport, then this
  45. option is supported for backward compatibility with other SSL engines, but it
  46. should not be set. If the option is not set, then curl will use the
  47. certificates in the system and user Keychain to verify the peer, which is the
  48. preferred method of verifying the peer's certificate chain.
  49. The application does not have to keep the string around after setting this
  50. option.
  51. The default value for this can be figured out with \fICURLINFO_CAINFO(3)\fP.
  52. .SH DEFAULT
  53. Built-in system specific
  54. .SH PROTOCOLS
  55. Used with HTTPS proxy
  56. .SH EXAMPLE
  57. .nf
  58. CURL *curl = curl_easy_init();
  59. if(curl) {
  60. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  61. /* using an HTTPS proxy */
  62. curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443");
  63. curl_easy_setopt(curl, CURLOPT_PROXY_CAINFO, "/etc/certs/cabundle.pem");
  64. ret = curl_easy_perform(curl);
  65. curl_easy_cleanup(curl);
  66. }
  67. .fi
  68. .SH AVAILABILITY
  69. Added in 7.52.0
  70. For TLS backends that do not support certificate files, the
  71. \fICURLOPT_PROXY_CAINFO(3)\fP option is ignored. Refer to
  72. https://curl.se/docs/ssl-compared.html
  73. .SH RETURN VALUE
  74. Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
  75. CURLE_OUT_OF_MEMORY if there was insufficient heap space.
  76. .SH "SEE ALSO"
  77. .BR CURLOPT_PROXY_CAINFO_BLOB "(3), " CURLOPT_PROXY_CAPATH "(3), "
  78. .BR CURLOPT_PROXY_SSL_VERIFYPEER "(3), " CURLOPT_PROXY_SSL_VERIFYHOST "(3), "
  79. .BR CURLOPT_CAINFO "(3), " CURLOPT_CAINFO_BLOB "(3), "
  80. .BR CURLOPT_CAPATH "(3), "
  81. .BR CURLOPT_SSL_VERIFYPEER "(3), " CURLOPT_SSL_VERIFYHOST "(3), "