]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/ssl/SSL_CTX_set_ct_validation_callback.pod
make update
[thirdparty/openssl.git] / doc / ssl / SSL_CTX_set_ct_validation_callback.pod
CommitLineData
238d692c
RP
1=pod
2
3=head1 NAME
4
43341433 5SSL_ct_enable, SSL_CTX_ct_enable, SSL_ct_disable, SSL_CTX_ct_disable,
238d692c 6SSL_set_ct_validation_callback, SSL_CTX_set_ct_validation_callback,
43341433 7SSL_ct_is_enabled, SSL_CTX_ct_is_enabled -
238d692c
RP
8control Certificate Transparency policy
9
10=head1 SYNOPSIS
11
12 #include <openssl/ssl.h>
13
43341433
VD
14 int SSL_ct_enable(SSL *s, int validation_mode);
15 int SSL_CTX_ct_enable(SSL_CTX *ctx, int validation_mode);
16 int SSL_set_ct_validation_callback(SSL *s, ssl_ct_validation_cb callback,
17 void *arg);
18 int SSL_CTX_set_ct_validation_callback(SSL_CTX *ctx,
19 ssl_ct_validation_cb callback,
20 void *arg);
21 void SSL_ct_disable(SSL *s);
22 void SSL_CTX_ct_disable(SSL_CTX *ctx);
23 int SSL_ct_is_enabled(const SSL *s);
24 int SSL_CTX_ct_is_enabled(const SSL_CTX *ctx);
238d692c
RP
25
26=head1 DESCRIPTION
27
43341433
VD
28SSL_ct_enable() and SSL_CTX_ct_enable() enable the processing of signed
29certificate timestamps (SCTs) either for a given SSL connection or for all
30connections that share the given SSL context, respectively.
31This is accomplished by setting a built-in CT validation callback.
32The behaviour of the callback is determined by the B<validation_mode> argument,
33which can be either of B<SSL_CT_VALIDATION_PERMISSIVE> or
34B<SSL_CT_VALIDATION_STRICT> as described below.
35
36If B<validation_mode> is equal to B<SSL_CT_VALIDATION_PERMISSIVE>, then the
37handshake continues regardless of the validation status of any SCTs.
38The application can inspect the validation status of the SCTs at handshake
39completion.
40Note that with session resumption there will not be any SCTs presented during
41the handshake.
42Therefore, in applications that delay SCT policy enforcement until after
43handshake completion, SCT checks should only be performed when the session is
44not reused.
45See L<SSL_session_reused(3)>.
46
47If B<validation_mode> is equal to B<SSL_CT_VALIDATION_STRICT>, then in a full
48TLS handshake with the verification mode set to B<SSL_VERIFY_PEER>, if the peer
49presents no valid SCTs the handshake will be aborted.
50See L<SSL_set_verify(3)>.
51
52SSL_set_ct_validation_callback() and SSL_CTX_set_ct_validation_callback()
53register a custom callback that may implement a different policy than either of
54the above.
55This callback can examine the peer's SCTs and determine whether they are
56sufficient to allow the connection to continue.
57The TLS handshake is aborted if the verification mode is not B<SSL_VERIFY_NONE>
58and the callback returns a non-positive result.
59
60An arbitrary callback context argument, B<arg>, can be passed in when setting
61the callback.
62This will be passed to the callback whenever it is invoked.
63Ownership of this context remains with the caller.
238d692c
RP
64
65If no callback is set, SCTs will not be requested and Certificate Transparency
66validation will not occur.
67
43341433
VD
68No callback will be invoked when the peer presents no certificate, e.g. by
69employing an anonymous (aNULL) ciphersuite.
70In that case the handshake continues as it would had no callback been
71requested.
72Callbacks are also not invoked when the peer certificate chain is invalid or
73validated via DANE-TA(2) or DANE-EE(3) TLSA records which use a private X.509
74PKI, or no X.509 PKI at all, respectively.
75Clients that require SCTs are expected to not have enabled any aNULL ciphers
76nor to have specified server verification via DANE-TA(2) or DANE-EE(3) TLSA
77records.
78
79SSL_ct_disable() and SSL_CTX_ct_disable() turn off CT processing, whether
80enabled via the built-in or the custom callbacks, by setting a NULL callback.
81These may be implemented as macros.
82
83SSL_ct_is_enabled() and SSL_CTX_ct_is_enabled() return 1 if CT processing is
84enabled via either SSL_ct_enable() or a non-null custom callback, and 0
85otherwise.
86
238d692c
RP
87=head1 NOTES
88
43341433
VD
89When SCT processing is enabled, OCSP stapling will be enabled. This is because
90one possible source of SCTs is the OCSP response from a server.
238d692c
RP
91
92=head1 RESTRICTIONS
93
94Certificate Transparency validation cannot be enabled and so a callback cannot
95be set if a custom client extension handler has been registered to handle SCT
96extensions (B<TLSEXT_TYPE_signed_certificate_timestamp>).
97
98=head1 RETURN VALUES
99
43341433
VD
100SSL_ct_enable(), SSL_CTX_ct_enable(), SSL_CTX_set_ct_validation_callback() and
101SSL_set_ct_validation_callback() return 1 if the B<callback> is successfully
102set.
103They return 0 if an error occurs, e.g. a custom client extension handler has
104been setup to handle SCTs.
105
106SSL_ct_disable() and SSL_CTX_ct_disable() do not return a result.
238d692c 107
43341433
VD
108SSL_CTX_ct_is_enabled() and SSL_ct_is_enabled() return a 1 if a non-null CT
109validation callback is set, or 0 if no callback (or equivalently a NULL
110callback) is set.
238d692c
RP
111
112=head1 SEE ALSO
113
114L<ssl(3)>,
43341433
VD
115L<SSL_session_reused(3)>,
116L<SSL_set_verify(3)>,
117L<SSL_CTX_set_verify(3)>,
118L<ssl_ct_validation_cb(3)>
238d692c
RP
119
120=cut