1gnutls_certificate_verify_peers(3)  gnutls  gnutls_certificate_verify_peers(3)
2
3
4

NAME

6       gnutls_certificate_verify_peers - API function
7

SYNOPSIS

9       #include <gnutls/gnutls.h>
10
11       int      gnutls_certificate_verify_peers(gnutls_session_t      session,
12       gnutls_typed_vdata_st * data, unsigned int  elements,  unsigned  int  *
13       status);
14

ARGUMENTS

16       gnutls_session_t session
17                   is a gnutls session
18
19       gnutls_typed_vdata_st * data
20                   an array of typed data
21
22       unsigned int elements
23                   the number of data elements
24
25       unsigned int * status
26                   is the output of the verification
27

DESCRIPTION

29       This function will verify the peer's certificate and store the the sta‐
30       tus in the  status variable as a bitwise OR of  gnutls_certificate_sta‐
31       tus_t  values or zero if the certificate is trusted. Note that value in
32       status is set only when the return value of this  function  is  success
33       (i.e,  failure  to trust a certificate does not imply a negative return
34       value).  The default verification flags used by this  function  can  be
35       overridden  using  gnutls_certificate_set_verify_flags(). See the docu‐
36       mentation of gnutls_certificate_verify_peers2() for details in the ver‐
37       ification process.
38
39       This function will take into account the stapled OCSP responses sent by
40       the server, as well as the following X.509 certificate extensions: Name
41       Constraints, Key Usage, and Basic Constraints (pathlen).
42
43       The     acceptable      data    types    are    GNUTLS_DT_DNS_HOSTNAME,
44       GNUTLS_DT_RFC822NAME and  GNUTLS_DT_KEY_PURPOSE_OID.   The  former  two
45       accept  as  data  a  null-terminated hostname or email address, and the
46       latter     a     null-terminated     object      identifier      (e.g.,
47       GNUTLS_KP_TLS_WWW_SERVER).
48
49       If a DNS hostname is provided then this function will compare the host‐
50       name in the certificate against the given. If names do  not  match  the
51       GNUTLS_CERT_UNEXPECTED_OWNER status flag will be set.  If a key purpose
52       OID is provided and the end-certificate contains the extended key usage
53       PKIX extension, it will be required to be have the provided key purpose
54       or be marked for any purpose, otherwise verification status  will  have
55       the GNUTLS_CERT_SIGNER_CONSTRAINTS_FAILURE flag set.
56
57       To  avoid denial of service attacks some default upper limits regarding
58       the certificate key size and chain size are set. To override  them  use
59       gnutls_certificate_set_verify_limits().
60

RETURNS

62       GNUTLS_E_SUCCESS  (0)  when  the validation is performed, or a negative
63       error code otherwise.  A successful error code means that  the   status
64       parameter must be checked to obtain the validation status.
65

SINCE

67       3.3.0
68

REPORTING BUGS

70       Report bugs to <bugs@gnutls.org>.
71       Home page: http://www.gnutls.org
72
73
75       Copyright © 2001-2018 Free Software Foundation, Inc., and others.
76       Copying  and  distribution  of this file, with or without modification,
77       are permitted in any medium  without  royalty  provided  the  copyright
78       notice and this notice are preserved.
79

SEE ALSO

81       The  full  documentation  for gnutls is maintained as a Texinfo manual.
82       If the /usr/share/doc/gnutls/ directory does not contain the HTML  form
83       visit
84
85       http://www.gnutls.org/manual/
86
87gnutls                               3.6.5  gnutls_certificate_verify_peers(3)
Impressum