summaryrefslogtreecommitdiff
path: root/src/lib/libssl/doc/SSL_CTX_set_cert_verify_callback.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/doc/SSL_CTX_set_cert_verify_callback.3')
-rw-r--r--src/lib/libssl/doc/SSL_CTX_set_cert_verify_callback.3109
1 files changed, 109 insertions, 0 deletions
diff --git a/src/lib/libssl/doc/SSL_CTX_set_cert_verify_callback.3 b/src/lib/libssl/doc/SSL_CTX_set_cert_verify_callback.3
new file mode 100644
index 0000000000..b34d3a6003
--- /dev/null
+++ b/src/lib/libssl/doc/SSL_CTX_set_cert_verify_callback.3
@@ -0,0 +1,109 @@
1.Dd $Mdocdate: October 12 2014 $
2.Dt SSL_CTX_SET_CERT_VERIFY_CALLBACK 3
3.Os
4.Sh NAME
5.Nm SSL_CTX_set_cert_verify_callback
6.Nd set peer certificate verification procedure
7.Sh SYNOPSIS
8.In openssl/ssl.h
9.Ft void
10.Fo SSL_CTX_set_cert_verify_callback
11.Fa "SSL_CTX *ctx"
12.Fa "int (*callback)(X509_STORE_CTX *, void *)"
13.Fa "void *arg"
14.Fc
15.Sh DESCRIPTION
16.Fn SSL_CTX_set_cert_verify_callback
17sets the verification callback function for
18.Fa ctx .
19.Vt SSL
20objects that are created from
21.Fa ctx
22inherit the setting valid at the time when
23.Xr SSL_new 3
24is called.
25.Sh NOTES
26Whenever a certificate is verified during a SSL/TLS handshake,
27a verification function is called.
28If the application does not explicitly specify a verification callback
29function, the built-in verification function is used.
30If a verification callback
31.Fa callback
32is specified via
33.Fn SSL_CTX_set_cert_verify_callback ,
34the supplied callback function is called instead.
35By setting
36.Fa callback
37to
38.Dv NULL ,
39the default behaviour is restored.
40.Pp
41When the verification must be performed,
42.Fa callback
43will be called with the arguments
44.Fn callback "X509_STORE_CTX *x509_store_ctx" "void *arg" .
45The argument
46.Fa arg
47is specified by the application when setting
48.Fa callback .
49.Pp
50.Fa callback
51should return 1 to indicate verification success and 0 to indicate verification
52failure.
53If
54.Dv SSL_VERIFY_PEER
55is set and
56.Fa callback
57returns 0, the handshake will fail.
58As the verification procedure may allow the connection to continue in case of
59failure (by always returning 1) the verification result must be set in any case
60using the
61.Fa error
62member of
63.Fa x509_store_ctx
64so that the calling application will be informed about the detailed result of
65the verification procedure!
66.Pp
67Within
68.Fa x509_store_ctx ,
69.Fa callback
70has access to the
71.Fa verify_callback
72function set using
73.Xr SSL_CTX_set_verify 3 .
74.Sh WARNINGS
75Do not mix the verification callback described in this function with the
76.Fa verify_callback
77function called during the verification process.
78The latter is set using the
79.Xr SSL_CTX_set_verify 3
80family of functions.
81.Pp
82Providing a complete verification procedure including certificate purpose
83settings, etc., is a complex task.
84The built-in procedure is quite powerful and in most cases it should be
85sufficient to modify its behaviour using the
86.Fa verify_callback
87function.
88.Sh RETURN VALUES
89.Fn SSL_CTX_set_cert_verify_callback
90does not provide diagnostic information.
91.Sh SEE ALSO
92.Xr ssl 3 ,
93.Xr SSL_CTX_load_verify_locations 3 ,
94.Xr SSL_CTX_set_verify 3 ,
95.Xr SSL_get_verify_result 3
96.Sh HISTORY
97Previous to OpenSSL 0.9.7, the
98.Fa arg
99argument to
100.Fn SSL_CTX_set_cert_verify_callback
101was ignored, and
102.Fa callback
103was called
104simply as
105.Ft int
106.Fn (*callback) "X509_STORE_CTX *" .
107To compile software written for previous versions of OpenSSL,
108a dummy argument will have to be added to
109.Fa callback .