1gnutls_certificate_verify_peers2(3) gnutls gnutls_certificate_verify_peers2(3)
2
3
4
6 gnutls_certificate_verify_peers2 - API function
7
9 #include <gnutls/gnutls.h>
10
11 int gnutls_certificate_verify_peers2(gnutls_session_t session, unsigned
12 int * status);
13
15 gnutls_session_t session
16 is a gnutls session
17
18 unsigned int * status
19 is the output of the verification
20
22 This function will verify the peer's certificate and store the status
23 in the status variable as a bitwise OR of gnutls_certificate_status_t
24 values or zero if the certificate is trusted. Note that value in sta‐
25 tus is set only when the return value of this function is success (i.e,
26 failure to trust a certificate does not imply a negative return value).
27 The default verification flags used by this function can be overridden
28 using gnutls_certificate_set_verify_flags().
29
30 This function will take into account the stapled OCSP responses sent by
31 the server, as well as the following X.509 certificate extensions: Name
32 Constraints, Key Usage, and Basic Constraints (pathlen).
33
34 Note that you must also check the peer's name in order to check if the
35 verified certificate belongs to the actual peer, see
36 gnutls_x509_crt_check_hostname(), or use gnutls_certificate_ver‐
37 ify_peers3().
38
39 To avoid denial of service attacks some default upper limits regarding
40 the certificate key size and chain size are set. To override them use
41 gnutls_certificate_set_verify_limits().
42
44 GNUTLS_E_SUCCESS [22m(0) when the validation is performed, or a negative
45 error code otherwise. A successful error code means that the status
46 parameter must be checked to obtain the validation status.
47
49 Report bugs to <bugs@gnutls.org>.
50 Home page: http://www.gnutls.org
51
52
54 Copyright © 2001-2018 Free Software Foundation, Inc., and others.
55 Copying and distribution of this file, with or without modification,
56 are permitted in any medium without royalty provided the copyright
57 notice and this notice are preserved.
58
60 The full documentation for gnutls is maintained as a Texinfo manual.
61 If the /usr/share/doc/gnutls/ directory does not contain the HTML form
62 visit
63
64 http://www.gnutls.org/manual/
65
66gnutls 3.6.5 gnutls_certificate_verify_peers2(3)