xref: /freebsd/crypto/openssl/doc/man3/SSL_CTX_get0_param.pod (revision 6966ac055c3b7a39266fb982493330df7a097997)
1=pod
2
3=head1 NAME
4
5SSL_CTX_get0_param, SSL_get0_param, SSL_CTX_set1_param, SSL_set1_param -
6get and set verification parameters
7
8=head1 SYNOPSIS
9
10 #include <openssl/ssl.h>
11
12 X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx)
13 X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl)
14 int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm)
15 int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm)
16
17=head1 DESCRIPTION
18
19SSL_CTX_get0_param() and SSL_get0_param() retrieve an internal pointer to
20the verification parameters for B<ctx> or B<ssl> respectively. The returned
21pointer must not be freed by the calling application.
22
23SSL_CTX_set1_param() and SSL_set1_param() set the verification parameters
24to B<vpm> for B<ctx> or B<ssl>.
25
26=head1 NOTES
27
28Typically parameters are retrieved from an B<SSL_CTX> or B<SSL> structure
29using SSL_CTX_get0_param() or SSL_get0_param() and an application modifies
30them to suit its needs: for example to add a hostname check.
31
32=head1 RETURN VALUES
33
34SSL_CTX_get0_param() and SSL_get0_param() return a pointer to an
35B<X509_VERIFY_PARAM> structure.
36
37SSL_CTX_set1_param() and SSL_set1_param() return 1 for success and 0
38for failure.
39
40=head1 EXAMPLES
41
42Check hostname matches "www.foo.com" in peer certificate:
43
44 X509_VERIFY_PARAM *vpm = SSL_get0_param(ssl);
45 X509_VERIFY_PARAM_set1_host(vpm, "www.foo.com", 0);
46
47=head1 SEE ALSO
48
49L<X509_VERIFY_PARAM_set_flags(3)>
50
51=head1 HISTORY
52
53These functions were added in OpenSSL 1.0.2.
54
55=head1 COPYRIGHT
56
57Copyright 2015-2019 The OpenSSL Project Authors. All Rights Reserved.
58
59Licensed under the OpenSSL license (the "License").  You may not use
60this file except in compliance with the License.  You can obtain a copy
61in the file LICENSE in the source distribution or at
62L<https://www.openssl.org/source/license.html>.
63
64=cut
65