CURLOPT_PROXY_CAINFO.3 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2017, 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.haxx.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. .\" **************************************************************************
  22. .\"
  23. .TH CURLOPT_PROXY_CAINFO 3 "April 17, 2018" "libcurl 7.61.1" "curl_easy_setopt options"
  24. .SH NAME
  25. CURLOPT_PROXY_CAINFO \- path to proxy Certificate Authority (CA) bundle
  26. .SH SYNOPSIS
  27. #include <curl/curl.h>
  28. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_CAINFO, char *path);
  29. .SH DESCRIPTION
  30. This option is for connecting to an HTTPS proxy, not an HTTPS server.
  31. Pass a char * to a zero terminated string naming a file holding one or more
  32. certificates to verify the HTTPS proxy with.
  33. If \fICURLOPT_PROXY_SSL_VERIFYPEER(3)\fP is zero and you avoid verifying the
  34. server's certificate, \fICURLOPT_PROXY_CAINFO(3)\fP need not even indicate an
  35. accessible file.
  36. This option is by default set to the system path where libcurl's cacert bundle
  37. is assumed to be stored, as established at build time.
  38. If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module
  39. (libnsspem.so) needs to be available for this option to work properly.
  40. (iOS and macOS only) If curl is built against Secure Transport, then this
  41. option is supported for backward compatibility with other SSL engines, but it
  42. should not be set. If the option is not set, then curl will use the
  43. certificates in the system and user Keychain to verify the peer, which is the
  44. preferred method of verifying the peer's certificate chain.
  45. The application does not have to keep the string around after setting this
  46. option.
  47. .SH DEFAULT
  48. Built-in system specific
  49. .SH PROTOCOLS
  50. Used with HTTPS proxy
  51. .SH EXAMPLE
  52. .nf
  53. CURL *curl = curl_easy_init();
  54. if(curl) {
  55. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  56. /* using an HTTPS proxy */
  57. curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443");
  58. curl_easy_setopt(curl, CURLOPT_PROXY_CAINFO, "/etc/certs/cabundle.pem");
  59. ret = curl_easy_perform(curl);
  60. curl_easy_cleanup(curl);
  61. }
  62. .fi
  63. .SH AVAILABILITY
  64. Added in 7.52.0
  65. For TLS backends that don't support certificate files, the
  66. \fICURLOPT_PROXY_CAINFO(3)\fP option is ignored. Refer to
  67. https://curl.haxx.se/docs/ssl-compared.html
  68. .SH RETURN VALUE
  69. Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
  70. CURLE_OUT_OF_MEMORY if there was insufficient heap space.
  71. .SH "SEE ALSO"
  72. .BR CURLOPT_PROXY_CAPATH "(3), "
  73. .BR CURLOPT_PROXY_SSL_VERIFYPEER "(3), " CURLOPT_PROXY_SSL_VERIFYHOST "(3), "
  74. .BR CURLOPT_CAPATH "(3), "
  75. .BR CURLOPT_SSL_VERIFYPEER "(3), " CURLOPT_SSL_VERIFYHOST "(3), "