xref: /freebsd/crypto/openssl/doc/man3/X509_load_http.pod (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1*b077aed3SPierre Pronchery=pod
2*b077aed3SPierre Pronchery
3*b077aed3SPierre Pronchery=head1 NAME
4*b077aed3SPierre Pronchery
5*b077aed3SPierre ProncheryX509_load_http,
6*b077aed3SPierre ProncheryX509_http_nbio,
7*b077aed3SPierre ProncheryX509_CRL_load_http,
8*b077aed3SPierre ProncheryX509_CRL_http_nbio
9*b077aed3SPierre Pronchery- certificate and CRL loading functions
10*b077aed3SPierre Pronchery
11*b077aed3SPierre Pronchery=head1 SYNOPSIS
12*b077aed3SPierre Pronchery
13*b077aed3SPierre Pronchery #include <openssl/x509.h>
14*b077aed3SPierre Pronchery
15*b077aed3SPierre Pronchery X509 *X509_load_http(const char *url, BIO *bio, BIO *rbio, int timeout);
16*b077aed3SPierre Pronchery X509_CRL *X509_CRL_load_http(const char *url, BIO *bio, BIO *rbio, int timeout);
17*b077aed3SPierre Pronchery
18*b077aed3SPierre ProncheryThe following macros have been deprecated since OpenSSL 3.0, and can be
19*b077aed3SPierre Proncheryhidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value,
20*b077aed3SPierre Proncherysee L<openssl_user_macros(7)>:
21*b077aed3SPierre Pronchery
22*b077aed3SPierre Pronchery #define X509_http_nbio(rctx, pcert)
23*b077aed3SPierre Pronchery #define X509_CRL_http_nbio(rctx, pcrl)
24*b077aed3SPierre Pronchery
25*b077aed3SPierre Pronchery=head1 DESCRIPTION
26*b077aed3SPierre Pronchery
27*b077aed3SPierre ProncheryX509_load_http() and X509_CRL_load_http() loads a certificate or a CRL,
28*b077aed3SPierre Proncheryrespectively, in ASN.1 format using HTTP from the given B<url>.
29*b077aed3SPierre Pronchery
30*b077aed3SPierre ProncheryIf B<bio> is given and B<rbio> is NULL then this BIO is used instead of an
31*b077aed3SPierre Proncheryinternal one for connecting, writing the request, and reading the response.
32*b077aed3SPierre ProncheryIf both B<bio> and B<rbio> are given (which may be memory BIOs, for instance)
33*b077aed3SPierre Proncherythen no explicit connection is attempted,
34*b077aed3SPierre ProncheryB<bio> is used for writing the request, and B<rbio> for reading the response.
35*b077aed3SPierre Pronchery
36*b077aed3SPierre ProncheryIf the B<timeout> parameter is > 0 this indicates the maximum number of seconds
37*b077aed3SPierre Proncheryto wait until the transfer is complete.
38*b077aed3SPierre ProncheryA value of 0 enables waiting indefinitely,
39*b077aed3SPierre Proncherywhile a value < 0 immediately leads to a timeout condition.
40*b077aed3SPierre Pronchery
41*b077aed3SPierre ProncheryX509_http_nbio() and X509_CRL_http_nbio() are macros for backward compatibility
42*b077aed3SPierre Proncherythat have the same effect as the functions above but with infinite timeout
43*b077aed3SPierre Proncheryand without the possibility to specify custom BIOs.
44*b077aed3SPierre Pronchery
45*b077aed3SPierre Pronchery=head1 RETURN VALUES
46*b077aed3SPierre Pronchery
47*b077aed3SPierre ProncheryOn success the function yield the loaded value, else NULL.
48*b077aed3SPierre ProncheryError conditions include connection/transfer timeout, parse errors, etc.
49*b077aed3SPierre Pronchery
50*b077aed3SPierre Pronchery=head1 SEE ALSO
51*b077aed3SPierre Pronchery
52*b077aed3SPierre ProncheryL<OSSL_HTTP_get(3)>
53*b077aed3SPierre Pronchery
54*b077aed3SPierre Pronchery=head1 HISTORY
55*b077aed3SPierre Pronchery
56*b077aed3SPierre ProncheryX509_load_http() and X509_CRL_load_http() were added in OpenSSL 3.0.
57*b077aed3SPierre ProncheryX509_http_nbio() and X509_CRL_http_nbio() were deprecated in OpenSSL 3.0.
58*b077aed3SPierre Pronchery
59*b077aed3SPierre Pronchery=head1 COPYRIGHT
60*b077aed3SPierre Pronchery
61*b077aed3SPierre ProncheryCopyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
62*b077aed3SPierre Pronchery
63*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
64*b077aed3SPierre Proncherythis file except in compliance with the License.  You can obtain a copy
65*b077aed3SPierre Proncheryin the file LICENSE in the source distribution or at
66*b077aed3SPierre ProncheryL<https://www.openssl.org/source/license.html>.
67*b077aed3SPierre Pronchery
68*b077aed3SPierre Pronchery=cut
69