1gnutls_x509_crt_check_hostname2(3) gnutls gnutls_x509_crt_check_hostname2(3)
2
3
4
6 gnutls_x509_crt_check_hostname2 - API function
7
9 #include <gnutls/x509.h>
10
11 int gnutls_x509_crt_check_hostname2(gnutls_x509_crt_t cert, const char
12 * hostname, unsigned int flags);
13
15 gnutls_x509_crt_t cert
16 should contain an gnutls_x509_crt_t structure
17
18 const char * hostname
19 A null terminated string that contains a DNS name
20
21 unsigned int flags
22 gnutls_certificate_verify_flags
23
25 This function will check if the given certificate's subject matches the
26 given hostname. This is a basic implementation of the matching
27 described in RFC6125, and takes into account wildcards, and the
28 DNSName/IPAddress subject alternative name PKIX extension.
29
30 IPv4 addresses are accepted by this function in the dotted-decimal for‐
31 mat (e.g, ddd.ddd.ddd.ddd), and IPv6 addresses in the hexadecimal
32 x:x:x:x:x:x:x:x format. For them the IPAddress subject alternative name
33 extension is consulted, as well as the DNSNames in case of a non-match.
34 The latter fallback exists due to misconfiguration of many servers
35 which place an IPAddress inside the DNSName extension.
36
37 The comparison of dns names may have false-negatives as it is done byte
38 by byte in non-ascii names.
39
40 When the flag GNUTLS_VERIFY_DO_NOT_ALLOW_WILDCARDS is specified no
41 wildcards are considered. Otherwise they are only considered if the
42 domain name consists of three components or more, and the wildcard
43 starts at the leftmost position.
44
46 non-zero for a successful match, and zero on failure.
47
49 Report bugs to <bugs@gnutls.org>.
50 Home page: http://www.gnutls.org
51
52
54 Copyright © 2001-2014 Free Software Foundation, Inc..
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.3.29 gnutls_x509_crt_check_hostname2(3)