2
0

CURLOPT_ISSUERCERT_BLOB.3 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2021, 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. .\" **************************************************************************
  22. .\"
  23. .TH CURLOPT_ISSUERCERT_BLOB 3 "24 Jun 2020" "libcurl 7.71.0" "curl_easy_setopt options"
  24. .SH NAME
  25. CURLOPT_ISSUERCERT_BLOB \- issuer SSL certificate from memory blob
  26. .SH SYNOPSIS
  27. .nf
  28. #include <curl/curl.h>
  29. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ISSUERCERT_BLOB,
  30. struct curl_blob *stblob);
  31. .fi
  32. .SH DESCRIPTION
  33. Pass a pointer to a curl_blob structure, which contains information (pointer
  34. and size) about a memory block with binary data of a CA certificate in PEM
  35. format. If the option is set, an additional check against the peer certificate
  36. is performed to verify the issuer is indeed the one associated with the
  37. certificate provided by the option. This additional check is useful in
  38. multi-level PKI where one needs to enforce that the peer certificate is from a
  39. specific branch of the tree.
  40. This option should be used in combination with the
  41. \fICURLOPT_SSL_VERIFYPEER(3)\fP option. Otherwise, the result of the check is
  42. not considered as failure.
  43. A specific error code (CURLE_SSL_ISSUER_ERROR) is defined with the option,
  44. which is returned if the setup of the SSL/TLS session has failed due to a
  45. mismatch with the issuer of peer certificate (\fICURLOPT_SSL_VERIFYPEER(3)\fP
  46. has to be set too for the check to fail).
  47. If the blob is initialized with the flags member of struct curl_blob set to
  48. CURL_BLOB_COPY, the application does not have to keep the buffer around after
  49. setting this.
  50. This option is an alternative to \fICURLOPT_ISSUERCERT(3)\fP which instead
  51. expects a file name as input.
  52. .SH DEFAULT
  53. NULL
  54. .SH PROTOCOLS
  55. All TLS-based protocols
  56. .SH EXAMPLE
  57. .nf
  58. CURL *curl = curl_easy_init();
  59. if(curl) {
  60. struct curl_blob blob;
  61. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  62. blob.data = certificateData;
  63. blob.len = filesize;
  64. blob.flags = CURL_BLOB_COPY;
  65. curl_easy_setopt(curl, CURLOPT_ISSUERCERT_BLOB, &blob);
  66. ret = curl_easy_perform(curl);
  67. curl_easy_cleanup(curl);
  68. }
  69. .fi
  70. .SH AVAILABILITY
  71. Added in 7.71.0. This option is supported by the OpenSSL backends.
  72. .SH RETURN VALUE
  73. Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
  74. CURLE_OUT_OF_MEMORY if there was insufficient heap space.
  75. .SH "SEE ALSO"
  76. .BR CURLOPT_ISSUERCERT "(3),"
  77. .BR CURLOPT_CRLFILE "(3), " CURLOPT_SSL_VERIFYPEER "(3), "