VirtualBox

source: vbox/trunk/src/libs/openssl-3.4.1/include/openssl/http.h

Last change on this file was 109052, checked in by vboxsync, 3 weeks ago

openssl-3.4.1: Applied our changes, regenerated files, added missing files and functions. This time with a three way merge. ​bugref:10890

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.5 KB
Line 
1/*
2 * Copyright 2000-2024 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
11#ifndef OPENSSL_HTTP_H
12# define OPENSSL_HTTP_H
13# pragma once
14
15# include <openssl/opensslconf.h>
16
17# include <openssl/bio.h>
18# include <openssl/asn1.h>
19# include <openssl/conf.h>
20
21
22# ifdef __cplusplus
23extern "C" {
24# endif
25
26# define OSSL_HTTP_NAME "http"
27# define OSSL_HTTPS_NAME "https"
28# define OSSL_HTTP_PREFIX OSSL_HTTP_NAME"://"
29# define OSSL_HTTPS_PREFIX OSSL_HTTPS_NAME"://"
30# define OSSL_HTTP_PORT "80"
31# define OSSL_HTTPS_PORT "443"
32# define OPENSSL_NO_PROXY "NO_PROXY"
33# define OPENSSL_HTTP_PROXY "HTTP_PROXY"
34# define OPENSSL_HTTPS_PROXY "HTTPS_PROXY"
35
36# ifndef OPENSSL_NO_HTTP
37
38# define OSSL_HTTP_DEFAULT_MAX_LINE_LEN (4 * 1024)
39# define OSSL_HTTP_DEFAULT_MAX_RESP_LEN (100 * 1024)
40# define OSSL_HTTP_DEFAULT_MAX_CRL_LEN (32 * 1024 * 1024)
41# define OSSL_HTTP_DEFAULT_MAX_RESP_HDR_LINES 256
42
43
44/* Low-level HTTP API */
45OSSL_HTTP_REQ_CTX *OSSL_HTTP_REQ_CTX_new(BIO *wbio, BIO *rbio, int buf_size);
46void OSSL_HTTP_REQ_CTX_free(OSSL_HTTP_REQ_CTX *rctx);
47int OSSL_HTTP_REQ_CTX_set_request_line(OSSL_HTTP_REQ_CTX *rctx, int method_POST,
48 const char *server, const char *port,
49 const char *path);
50int OSSL_HTTP_REQ_CTX_add1_header(OSSL_HTTP_REQ_CTX *rctx,
51 const char *name, const char *value);
52int OSSL_HTTP_REQ_CTX_set_expected(OSSL_HTTP_REQ_CTX *rctx,
53 const char *content_type, int asn1,
54 int timeout, int keep_alive);
55int OSSL_HTTP_REQ_CTX_set1_req(OSSL_HTTP_REQ_CTX *rctx, const char *content_type,
56 const ASN1_ITEM *it, const ASN1_VALUE *req);
57int OSSL_HTTP_REQ_CTX_nbio(OSSL_HTTP_REQ_CTX *rctx);
58int OSSL_HTTP_REQ_CTX_nbio_d2i(OSSL_HTTP_REQ_CTX *rctx,
59 ASN1_VALUE **pval, const ASN1_ITEM *it);
60BIO *OSSL_HTTP_REQ_CTX_exchange(OSSL_HTTP_REQ_CTX *rctx);
61BIO *OSSL_HTTP_REQ_CTX_get0_mem_bio(const OSSL_HTTP_REQ_CTX *rctx);
62size_t OSSL_HTTP_REQ_CTX_get_resp_len(const OSSL_HTTP_REQ_CTX *rctx);
63void OSSL_HTTP_REQ_CTX_set_max_response_length(OSSL_HTTP_REQ_CTX *rctx,
64 unsigned long len);
65int OSSL_HTTP_is_alive(const OSSL_HTTP_REQ_CTX *rctx);
66
67/* High-level HTTP API */
68typedef BIO *(*OSSL_HTTP_bio_cb_t)(BIO *bio, void *arg, int connect, int detail);
69OSSL_HTTP_REQ_CTX *OSSL_HTTP_open(const char *server, const char *port,
70 const char *proxy, const char *no_proxy,
71 int use_ssl, BIO *bio, BIO *rbio,
72 OSSL_HTTP_bio_cb_t bio_update_fn, void *arg,
73 int buf_size, int overall_timeout);
74int OSSL_HTTP_proxy_connect(BIO *bio, const char *server, const char *port,
75 const char *proxyuser, const char *proxypass,
76 int timeout, BIO *bio_err, const char *prog);
77int OSSL_HTTP_set1_request(OSSL_HTTP_REQ_CTX *rctx, const char *path,
78 const STACK_OF(CONF_VALUE) *headers,
79 const char *content_type, BIO *req,
80 const char *expected_content_type, int expect_asn1,
81 size_t max_resp_len, int timeout, int keep_alive);
82BIO *OSSL_HTTP_exchange(OSSL_HTTP_REQ_CTX *rctx, char **redirection_url);
83BIO *OSSL_HTTP_get(const char *url, const char *proxy, const char *no_proxy,
84 BIO *bio, BIO *rbio,
85 OSSL_HTTP_bio_cb_t bio_update_fn, void *arg,
86 int buf_size, const STACK_OF(CONF_VALUE) *headers,
87 const char *expected_content_type, int expect_asn1,
88 size_t max_resp_len, int timeout);
89BIO *OSSL_HTTP_transfer(OSSL_HTTP_REQ_CTX **prctx,
90 const char *server, const char *port,
91 const char *path, int use_ssl,
92 const char *proxy, const char *no_proxy,
93 BIO *bio, BIO *rbio,
94 OSSL_HTTP_bio_cb_t bio_update_fn, void *arg,
95 int buf_size, const STACK_OF(CONF_VALUE) *headers,
96 const char *content_type, BIO *req,
97 const char *expected_content_type, int expect_asn1,
98 size_t max_resp_len, int timeout, int keep_alive);
99int OSSL_HTTP_close(OSSL_HTTP_REQ_CTX *rctx, int ok);
100
101/* Auxiliary functions */
102int OSSL_parse_url(const char *url, char **pscheme, char **puser, char **phost,
103 char **pport, int *pport_num,
104 char **ppath, char **pquery, char **pfrag);
105int OSSL_HTTP_parse_url(const char *url, int *pssl, char **puser, char **phost,
106 char **pport, int *pport_num,
107 char **ppath, char **pquery, char **pfrag);
108const char *OSSL_HTTP_adapt_proxy(const char *proxy, const char *no_proxy,
109 const char *server, int use_ssl);
110
111void OSSL_HTTP_REQ_CTX_set_max_response_hdr_lines(OSSL_HTTP_REQ_CTX *rctx,
112 size_t count);
113
114# endif /* !defined(OPENSSL_NO_HTTP) */
115# ifdef __cplusplus
116}
117# endif
118#endif /* !defined(OPENSSL_HTTP_H) */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette