Deprecate OCSP_xxx API for OSSL_HTTP_xxx
[openssl.git] / doc / man3 / OCSP_sendreq_new.pod
1 =pod
2
3 =head1 NAME
4
5 OCSP_sendreq_new,
6 OCSP_sendreq_nbio,
7 OCSP_sendreq_bio,
8 OCSP_REQ_CTX_i2d,
9 OCSP_REQ_CTX_add1_header,
10 OCSP_REQ_CTX_free,
11 OCSP_set_max_response_length,
12 OCSP_REQ_CTX_set1_req
13 - OCSP responder query functions
14
15 =head1 SYNOPSIS
16
17  #include <openssl/ocsp.h>
18
19  OSSL_HTTP_REQ_CTX *OCSP_sendreq_new(BIO *io, const char *path,
20                                      OCSP_REQUEST *req, int maxline);
21
22  int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OSSL_HTTP_REQ_CTX *rctx);
23
24  OCSP_RESPONSE *OCSP_sendreq_bio(BIO *io, const char *path, OCSP_REQUEST *req);
25
26 Deprecated since OpenSSL 3.0, can be hidden entirely by defining
27 B<OPENSSL_API_COMPAT> with a suitable version value, see
28 L<openssl_user_macros(7)>:
29
30  int OCSP_REQ_CTX_i2d(OCSP_REQ_CT *rctx, const char *content_type,
31                       const ASN1_ITEM *it, ASN1_VALUE *req);
32  int OCSP_REQ_CTX_add1_header(OCSP_REQ_CT *rctx,
33                               const char *name, const char *value);
34  void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx);
35  void OCSP_set_max_response_length(OCSP_REQ_CT *rctx,
36                                    unsigned long len);
37  int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, const OCSP_REQUEST *req);
38
39 =head1 DESCRIPTION
40
41 These functions perform an OCSP request / response transfer over HTTP, using
42 the HTTP request functions described in L<OSSL_HTTP_REQ_CTX(3)>.
43
44 The function OCSP_sendreq_new() builds a complete B<OSSL_HTTP_REQ_CTX>
45 structure using connection B<BIO> I<io>, the URL path I<path>, the OCSP
46 request I<req> and with a response header maximum line length of I<maxline>.
47 If I<maxline> is zero a default value of 4k is used. The OCSP request I<req>
48 may be set to NULL and provided later with L<OSSL_HTTP_REQ_CTX_i2d(3)> if
49 required.
50
51 The I<io> and I<path> arguments to OCSP_sendreq_new() correspond to the
52 components of the URL.
53 For example if the responder URL is C<http://example.com/ocspreq> the BIO
54 I<io> should be connected to host C<example.com> on port 80 and I<path>
55 should be set to C</ocspreq>.
56
57 OCSP_sendreq_nbio() performs I/O on the OCSP request context I<rctx>.
58 When the operation is complete it assigns the response, a pointer to a
59 B<OCSP_RESPONSE> structure, in I<*presp>.
60
61 OCSP_sendreq_bio() is the same as a call to OCSP_sendreq_new() followed by
62 OCSP_sendreq_nbio() and then OCSP_REQ_CTX_free() in a single call, with a
63 response header maximum line length 4k. It waits indefinitely on a response.
64 It does not support setting a timeout or adding headers and is retained
65 for compatibility; use OCSP_sendreq_nbio() instead.
66
67 OCSP_REQ_CTX_set1_req(rctx, req) is equivalent to the following:
68
69  OSSL_HTTP_REQ_CTX_i2d(rctx, "application/ocsp-request",
70                        ASN1_ITEM_rptr(OCSP_REQUEST), (ASN1_VALUE *)req)
71
72 The other deprecated type and functions have been superseded by the
73 following equivalents:
74 B<OCSP_REQ_CTX> by L<OSSL_HTTP_REQ_CTX(3)>,
75 OCSP_REQ_CTX_i2d() by L<OSSL_HTTP_REQ_CTX_i2d(3)>,
76 OCSP_REQ_CTX_add1_header() by L<OSSL_HTTP_REQ_CTX_add1_header(3)>,
77 OCSP_REQ_CTX_free() by L<OSSL_HTTP_REQ_CTX_free(3)>, and
78 OCSP_set_max_response_length() by
79 L<OSSL_HTTP_REQ_CTX_set_max_response_length(3)>.
80
81 =head1 RETURN VALUES
82
83 OCSP_sendreq_new() returns a valid B<OSSL_HTTP_REQ_CTX> structure or NULL
84 if an error occurred.
85
86 OCSP_sendreq_nbio(), OCSP_REQ_CTX_i2d(), and OCSP_REQ_CTX_set1_req()
87 return 1 for success and 0 for failure.
88
89 OCSP_sendreq_bio() returns the B<OCSP_RESPONSE> structure sent by the
90 responder or NULL if an error occurred.
91
92 =head1 SEE ALSO
93
94 L<crypto(7)>,
95 L<OCSP_cert_to_id(3)>,
96 L<OCSP_request_add1_nonce(3)>,
97 L<OCSP_REQUEST_new(3)>,
98 L<OCSP_resp_find_status(3)>,
99 L<OCSP_response_status(3)>
100
101 =head1 HISTORY
102
103 B<OCSP_REQ_CTX>,
104 OCSP_REQ_CTX_i2d(),
105 OCSP_REQ_CTX_add1_header(),
106 OCSP_REQ_CTX_free(),
107 OCSP_set_max_response_length(),
108 and OCSP_REQ_CTX_set1_req()
109 were deprecated in OpenSSL 3.0.
110
111 =head1 COPYRIGHT
112
113 Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
114
115 Licensed under the Apache License 2.0 (the "License").  You may not use
116 this file except in compliance with the License.  You can obtain a copy
117 in the file LICENSE in the source distribution or at
118 L<https://www.openssl.org/source/license.html>.
119
120 =cut