]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/SSL_CTX_get0_param.pod
Update copyright year
[thirdparty/openssl.git] / doc / man3 / SSL_CTX_get0_param.pod
CommitLineData
77672802
DSH
1=pod
2
3=head1 NAME
4
eb27a90e
HL
5SSL_CTX_get0_param, SSL_get0_param, SSL_CTX_set1_param, SSL_set1_param,
6SSL_CTX_set_purpose, SSL_CTX_set_trust, SSL_set_purpose, SSL_set_trust -
77672802
DSH
7get and set verification parameters
8
9=head1 SYNOPSIS
10
11 #include <openssl/ssl.h>
12
f64f17c3
SL
13 X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx);
14 X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl);
15 int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm);
16 int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm);
77672802 17
eb27a90e
HL
18 int SSL_CTX_set_purpose(SSL_CTX *ctx, int purpose);
19 int SSL_set_purpose(SSL *ssl, int purpose);
20
21 int SSL_CTX_set_trust(SSL_CTX *ctx, int trust);
22 int SSL_set_trust(SSL *ssl, int trust);
23
77672802
DSH
24=head1 DESCRIPTION
25
26SSL_CTX_get0_param() and SSL_get0_param() retrieve an internal pointer to
27the verification parameters for B<ctx> or B<ssl> respectively. The returned
28pointer must not be freed by the calling application.
29
30SSL_CTX_set1_param() and SSL_set1_param() set the verification parameters
31to B<vpm> for B<ctx> or B<ssl>.
32
eb27a90e
HL
33The functions SSL_CTX_set_purpose() and SSL_set_purpose() are shorthands which
34set the purpose parameter on the verification parameters object. These functions
35are equivalent to calling X509_VERIFY_PARAM_set_purpose() directly.
36
37The functions SSL_CTX_set_trust() and SSL_set_trust() are similarly shorthands
38which set the trust parameter on the verification parameters object. These
39functions are equivalent to calling X509_VERIFY_PARAM_set_trust() directly.
40
77672802
DSH
41=head1 NOTES
42
43Typically parameters are retrieved from an B<SSL_CTX> or B<SSL> structure
44using SSL_CTX_get0_param() or SSL_get0_param() and an application modifies
45them to suit its needs: for example to add a hostname check.
46
77672802
DSH
47=head1 RETURN VALUES
48
49SSL_CTX_get0_param() and SSL_get0_param() return a pointer to an
50B<X509_VERIFY_PARAM> structure.
51
eb27a90e
HL
52SSL_CTX_set1_param(), SSL_set1_param(), SSL_CTX_set_purpose(),
53SSL_set_purpose(), SSL_CTX_set_trust() and SSL_set_trust() return 1 for success
54and 0 for failure.
77672802 55
cda77422 56=head1 EXAMPLES
39a117d1
RS
57
58Check hostname matches "www.foo.com" in peer certificate:
59
60 X509_VERIFY_PARAM *vpm = SSL_get0_param(ssl);
61 X509_VERIFY_PARAM_set1_host(vpm, "www.foo.com", 0);
62
77672802
DSH
63=head1 SEE ALSO
64
98ca37e4 65L<ssl(7)>,
9b86974e 66L<X509_VERIFY_PARAM_set_flags(3)>
77672802
DSH
67
68=head1 HISTORY
69
fc5ecadd 70These functions were added in OpenSSL 1.0.2.
77672802 71
e2f92610
RS
72=head1 COPYRIGHT
73
fecb3aae 74Copyright 2015-2022 The OpenSSL Project Authors. All Rights Reserved.
e2f92610 75
4746f25a 76Licensed under the Apache License 2.0 (the "License"). You may not use
e2f92610
RS
77this file except in compliance with the License. You can obtain a copy
78in the file LICENSE in the source distribution or at
79L<https://www.openssl.org/source/license.html>.
80
81=cut