1 .\" $OpenBSD: OCSP_sendreq_new.3,v 1.4 2017/07/06 15:42:04 schwarze Exp $
2 .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
4 .\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
5 .\" Copyright (c) 2014, 2016 The OpenSSL Project. All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in
16 .\" the documentation and/or other materials provided with the
19 .\" 3. All advertising materials mentioning features or use of this
20 .\" software must display the following acknowledgment:
21 .\" "This product includes software developed by the OpenSSL Project
22 .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24 .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25 .\" endorse or promote products derived from this software without
26 .\" prior written permission. For written permission, please contact
27 .\" openssl-core@openssl.org.
29 .\" 5. Products derived from this software may not be called "OpenSSL"
30 .\" nor may "OpenSSL" appear in their names without prior written
31 .\" permission of the OpenSSL Project.
33 .\" 6. Redistributions of any form whatsoever must retain the following
35 .\" "This product includes software developed by the OpenSSL Project
36 .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38 .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39 .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42 .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49 .\" OF THE POSSIBILITY OF SUCH DAMAGE.
51 .Dd $Mdocdate: July 6 2017 $
52 .Dt OCSP_SENDREQ_NEW 3
55 .Nm OCSP_sendreq_new ,
56 .Nm OCSP_sendreq_nbio ,
57 .Nm OCSP_REQ_CTX_free ,
58 .Nm OCSP_REQ_CTX_add1_header ,
59 .Nm OCSP_REQ_CTX_set1_req ,
61 .Nd OCSP responder query functions
67 .Fa "const char *path"
68 .Fa "OCSP_REQUEST *req"
73 .Fa "OCSP_RESPONSE **presp"
74 .Fa "OCSP_REQ_CTX *rctx"
78 .Fa "OCSP_REQ_CTX *rctx"
81 .Fo OCSP_REQ_CTX_add1_header
82 .Fa "OCSP_REQ_CTX *rctx"
83 .Fa "const char *name"
84 .Fa "const char *value"
87 .Fo OCSP_REQ_CTX_set1_req
88 .Fa "OCSP_REQ_CTX *rctx"
89 .Fa "OCSP_REQUEST *req"
94 .Fa "const char *path"
95 .Fa "OCSP_REQUEST *req"
102 structure using the responder
108 and with a response header maximum line length of
112 is zero, a default value of 4k is used.
117 and provided later if required.
121 correspond to the components of the URI.
122 For example, if the responder URI is
123 .Pa http://ocsp.com/ocspreq ,
126 should be connected to host
133 .Fn OCSP_sendreq_nbio
134 performs non-blocking I/O on the OCSP request context
136 When the operation is complete it returns the response in
139 .Fn OCSP_sendreq_nbio
140 indicates an operation should be retried, the corresponding BIO can
141 be examined to determine which operation (read or write) should be
142 retried and appropriate action can be taken, for example a
144 call on the underlying socket.
146 .Fn OCSP_REQ_CTX_free
147 frees up the OCSP context
150 .Fn OCSP_REQ_CTX_add1_header
157 The added headers are of the form
165 .Fn OCSP_REQ_CTX_add1_header
166 can be called more than once to add multiple headers.
167 It must be called before any calls to
168 .Fn OCSP_sendreq_nbio .
171 parameter in the initial to
175 if additional headers are set.
177 .Fn OCSP_REQ_CTX_set1_req
178 sets the OCSP request in
182 This function should be called after any calls to
183 .Fn OCSP_REQ_CTX_add1_header .
186 performs an OCSP request using the responder
192 It does not support retries and so cannot handle non-blocking I/O
194 It is retained for compatibility and its use in new applications
202 if an error occurred.
204 .Fn OCSP_sendreq_nbio
205 returns 1 if the operation was completed successfully,
206 -1 if the operation should be retried,
207 or 0 if an error occurred.
209 .Fn OCSP_REQ_CTX_add1_header
211 .Fn OCSP_REQ_CTX_set1_req
212 return 1 for success or 0 for failure.
217 structure sent by the responder or
219 if an error occurred.
221 Add a Host header for
224 .Dl OCSP_REQ_CTX_add1_header(ctx, "Host", "ocsp.com");
226 .Xr OCSP_cert_to_id 3 ,
227 .Xr OCSP_request_add1_nonce 3 ,
228 .Xr OCSP_REQUEST_new 3 ,
229 .Xr OCSP_resp_find_status 3 ,
230 .Xr OCSP_response_status 3
232 These functions only perform a minimal HTTP query to a responder.
233 If an application wishes to support more advanced features, it
234 should use an alternative, more complete, HTTP library.
236 Currently only HTTP POST queries to responders are supported.