1SSL_CTX_SET_CERT_STORE(3ossl)       OpenSSL      SSL_CTX_SET_CERT_STORE(3ossl)
2
3
4

NAME

6       SSL_CTX_set_cert_store, SSL_CTX_set1_cert_store, SSL_CTX_get_cert_store
7       - manipulate X509 certificate verification storage
8

SYNOPSIS

10        #include <openssl/ssl.h>
11
12        void SSL_CTX_set_cert_store(SSL_CTX *ctx, X509_STORE *store);
13        void SSL_CTX_set1_cert_store(SSL_CTX *ctx, X509_STORE *store);
14        X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *ctx);
15

DESCRIPTION

17       SSL_CTX_set_cert_store() sets/replaces the certificate verification
18       storage of ctx to/with store. If another X509_STORE object is currently
19       set in ctx, it will be X509_STORE_free()ed.
20
21       SSL_CTX_set1_cert_store() sets/replaces the certificate verification
22       storage of ctx to/with store. The store's reference count is
23       incremented.  If another X509_STORE object is currently set in ctx, it
24       will be X509_STORE_free()ed.
25
26       SSL_CTX_get_cert_store() returns a pointer to the current certificate
27       verification storage.
28

NOTES

30       In order to verify the certificates presented by the peer, trusted CA
31       certificates must be accessed. These CA certificates are made available
32       via lookup methods, handled inside the X509_STORE. From the X509_STORE
33       the X509_STORE_CTX used when verifying certificates is created.
34
35       Typically the trusted certificate store is handled indirectly via using
36       SSL_CTX_load_verify_locations(3).  Using the SSL_CTX_set_cert_store()
37       and SSL_CTX_get_cert_store() functions it is possible to manipulate the
38       X509_STORE object beyond the SSL_CTX_load_verify_locations(3) call.
39
40       Currently no detailed documentation on how to use the X509_STORE object
41       is available. Not all members of the X509_STORE are used when the
42       verification takes place. So will e.g. the verify_callback() be
43       overridden with the verify_callback() set via the SSL_CTX_set_verify(3)
44       family of functions.  This document must therefore be updated when
45       documentation about the X509_STORE object and its handling becomes
46       available.
47
48       SSL_CTX_set_cert_store() does not increment the store's reference
49       count, so it should not be used to assign an X509_STORE that is owned
50       by another SSL_CTX.
51
52       To share X509_STOREs between two SSL_CTXs, use SSL_CTX_get_cert_store()
53       to get the X509_STORE from the first SSL_CTX, and then use
54       SSL_CTX_set1_cert_store() to assign to the second SSL_CTX and increment
55       the reference count of the X509_STORE.
56

RESTRICTIONS

58       The X509_STORE structure used by an SSL_CTX is used for verifying peer
59       certificates and building certificate chains, it is also shared by
60       every child SSL structure. Applications wanting finer control can use
61       functions such as SSL_CTX_set1_verify_cert_store() instead.
62

RETURN VALUES

64       SSL_CTX_set_cert_store() does not return diagnostic output.
65
66       SSL_CTX_set1_cert_store() does not return diagnostic output.
67
68       SSL_CTX_get_cert_store() returns the current setting.
69

SEE ALSO

71       ssl(7), SSL_CTX_load_verify_locations(3), SSL_CTX_set_verify(3)
72
74       Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved.
75
76       Licensed under the Apache License 2.0 (the "License").  You may not use
77       this file except in compliance with the License.  You can obtain a copy
78       in the file LICENSE in the source distribution or at
79       <https://www.openssl.org/source/license.html>.
80
81
82
833.0.9                             2023-07-27     SSL_CTX_SET_CERT_STORE(3ossl)
Impressum