openssl.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef HEADER_CURL_SSLUSE_H
  2. #define HEADER_CURL_SSLUSE_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  11. *
  12. * This software is licensed as described in the file COPYING, which
  13. * you should have received as part of this distribution. The terms
  14. * are also available at https://curl.se/docs/copyright.html.
  15. *
  16. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  17. * copies of the Software, and permit persons to whom the Software is
  18. * furnished to do so, under the terms of the COPYING file.
  19. *
  20. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  21. * KIND, either express or implied.
  22. *
  23. * SPDX-License-Identifier: curl
  24. *
  25. ***************************************************************************/
  26. #include "curl_setup.h"
  27. #ifdef USE_OPENSSL
  28. /*
  29. * This header should only be needed to get included by vtls.c, openssl.c
  30. * and ngtcp2.c
  31. */
  32. #include <openssl/ossl_typ.h>
  33. #include <openssl/ssl.h>
  34. #include "urldata.h"
  35. #if (OPENSSL_VERSION_NUMBER < 0x30000000L)
  36. #define SSL_get1_peer_certificate SSL_get_peer_certificate
  37. #endif
  38. CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn,
  39. struct ssl_peer *peer, X509 *server_cert);
  40. extern const struct Curl_ssl Curl_ssl_openssl;
  41. CURLcode Curl_ossl_set_client_cert(struct Curl_easy *data,
  42. SSL_CTX *ctx, char *cert_file,
  43. const struct curl_blob *cert_blob,
  44. const char *cert_type, char *key_file,
  45. const struct curl_blob *key_blob,
  46. const char *key_type, char *key_passwd);
  47. CURLcode Curl_ossl_certchain(struct Curl_easy *data, SSL *ssl);
  48. /**
  49. * Setup the OpenSSL X509_STORE in `ssl_ctx` for the cfilter `cf` and
  50. * easy handle `data`. Will allow reuse of a shared cache if suitable
  51. * and configured.
  52. */
  53. CURLcode Curl_ssl_setup_x509_store(struct Curl_cfilter *cf,
  54. struct Curl_easy *data,
  55. SSL_CTX *ssl_ctx);
  56. CURLcode Curl_ossl_ctx_configure(struct Curl_cfilter *cf,
  57. struct Curl_easy *data,
  58. SSL_CTX *ssl_ctx);
  59. #endif /* USE_OPENSSL */
  60. #endif /* HEADER_CURL_SSLUSE_H */