xref: /freebsd/crypto/openssl/doc/man3/OSSL_CMP_MSG_http_perform.pod (revision e7be843b4a162e68651d3911f0357ed464915629)
1=pod
2
3=head1 NAME
4
5OSSL_CMP_MSG_http_perform
6- client-side HTTP(S) transfer of a CMP request-response pair
7
8=head1 SYNOPSIS
9
10 #include <openssl/cmp.h>
11
12 OSSL_CMP_MSG *OSSL_CMP_MSG_http_perform(OSSL_CMP_CTX *ctx,
13                                         const OSSL_CMP_MSG *req);
14
15=head1 DESCRIPTION
16
17OSSL_CMP_MSG_http_perform() sends the given PKIMessage I<req> to the
18CMP server specified in I<ctx> and returns the result obtained from it.
19
20If L<OSSL_CMP_CTX_set_transfer_cb_arg(3)> has been used to set the transfer
21callback argument then the provided pointer I<bios> is taken as
22a two-element B<BIO> array to use for the exchange with the server
23as described for the I<bio> and I<rbio> parameters of L<OSSL_HTTP_open(3)>.
24For instance, the two BIO pointers may be equal and refer to a TLS connection,
25such as in BRSKI-AE where a pre-established TLS channel is reused for CMP.
26
27Otherwise the server specified via L<OSSL_CMP_CTX_set1_server(3)>
28and optionally L<OSSL_CMP_CTX_set_serverPort(3)> is contacted,
29where the default port is 80 for HTTP and 443 for HTTPS.
30The HTTP path (aka "CMP alias" in this context) to use is by default C</>,
31otherwise the string specified via L<OSSL_CMP_CTX_set1_serverPath(3)>.
32On success the function returns the server's response PKIMessage.
33
34The function makes use of any HTTP callback function
35set via L<OSSL_CMP_CTX_set_http_cb(3)>.
36It respects any timeout value set via L<OSSL_CMP_CTX_set_option(3)>
37with an B<OSSL_CMP_OPT_MSG_TIMEOUT> argument.
38It also respects any HTTP(S) proxy options set via L<OSSL_CMP_CTX_set1_proxy(3)>
39and L<OSSL_CMP_CTX_set1_no_proxy(3)> and the respective environment variables.
40Proxying plain HTTP is supported directly,
41while using a proxy for HTTPS connections requires a suitable callback function
42such as L<OSSL_HTTP_proxy_connect(3)>.
43
44=head1 NOTES
45
46CMP is defined in RFC 4210.
47HTTP transfer for CMP is defined in RFC 6712.
48
49=head1 RETURN VALUES
50
51OSSL_CMP_MSG_http_perform()
52returns the received CMP response message on success, else NULL.
53
54=head1 SEE ALSO
55
56L<OSSL_CMP_CTX_new(3)>, L<OSSL_HTTP_open(3)>, and L<OSSL_HTTP_proxy_connect(3)>.
57
58=head1 HISTORY
59
60The OpenSSL CMP support was added in OpenSSL 3.0.
61
62The OSSL_CMP_MSG_http_perform() use of transfer_cb_arg was added in OpenSSL 3.5.
63
64=head1 COPYRIGHT
65
66Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved.
67
68Licensed under the Apache License 2.0 (the "License").  You may not use
69this file except in compliance with the License.  You can obtain a copy
70in the file LICENSE in the source distribution or at
71L<https://www.openssl.org/source/license.html>.
72
73=cut
74