http.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
  3. * Copyright Siemens AG 2018-2020
  4. *
  5. * Licensed under the Apache License 2.0 (the "License"). You may not use
  6. * this file except in compliance with the License. You can obtain a copy
  7. * in the file LICENSE in the source distribution or at
  8. * https://www.openssl.org/source/license.html
  9. */
  10. #ifndef OPENSSL_HTTP_H
  11. # define OPENSSL_HTTP_H
  12. # pragma once
  13. # include <openssl/opensslconf.h>
  14. # include <openssl/bio.h>
  15. # include <openssl/asn1.h>
  16. # include <openssl/conf.h>
  17. # ifdef __cplusplus
  18. extern "C" {
  19. # endif
  20. typedef BIO *(*OSSL_HTTP_bio_cb_t)(BIO *bio, void *arg, int connect, int detail);
  21. # ifndef OPENSSL_NO_SOCK
  22. BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *proxy_port,
  23. BIO *bio, BIO *rbio,
  24. OSSL_HTTP_bio_cb_t bio_update_fn, void *arg,
  25. const STACK_OF(CONF_VALUE) *headers,
  26. int maxline, unsigned long max_resp_len, int timeout,
  27. const char *expected_content_type, int expect_asn1);
  28. ASN1_VALUE *OSSL_HTTP_get_asn1(const char *url,
  29. const char *proxy, const char *proxy_port,
  30. BIO *bio, BIO *rbio,
  31. OSSL_HTTP_bio_cb_t bio_update_fn, void *arg,
  32. const STACK_OF(CONF_VALUE) *headers,
  33. int maxline, unsigned long max_resp_len,
  34. int timeout, const char *expected_content_type,
  35. const ASN1_ITEM *it);
  36. ASN1_VALUE *OSSL_HTTP_post_asn1(const char *server, const char *port,
  37. const char *path, int use_ssl,
  38. const char *proxy, const char *proxy_port,
  39. BIO *bio, BIO *rbio,
  40. OSSL_HTTP_bio_cb_t bio_update_fn, void *arg,
  41. const STACK_OF(CONF_VALUE) *headers,
  42. const char *content_type,
  43. ASN1_VALUE *req, const ASN1_ITEM *req_it,
  44. int maxline, unsigned long max_resp_len,
  45. int timeout, const char *expected_ct,
  46. const ASN1_ITEM *rsp_it);
  47. BIO *OSSL_HTTP_transfer(const char *server, const char *port, const char *path,
  48. int use_ssl, const char *proxy, const char *proxy_port,
  49. BIO *bio, BIO *rbio,
  50. OSSL_HTTP_bio_cb_t bio_update_fn, void *arg,
  51. const STACK_OF(CONF_VALUE) *headers,
  52. const char *content_type, BIO *req_mem,
  53. int maxline, unsigned long max_resp_len, int timeout,
  54. const char *expected_ct, int expect_asn1,
  55. char **redirection_url);
  56. int OSSL_HTTP_proxy_connect(BIO *bio, const char *server, const char *port,
  57. const char *proxyuser, const char *proxypass,
  58. int timeout, BIO *bio_err, const char *prog);
  59. # endif
  60. int OSSL_HTTP_parse_url(const char *url, char **phost, char **pport,
  61. char **ppath, int *pssl);
  62. # ifdef __cplusplus
  63. }
  64. # endif
  65. #endif /* !defined OPENSSL_HTTP_H */