Eli Zaretskii *eliz [at] gnu.org*
Patrick Pelletier *code [at] funwithsoftware.org*
Sean Buckheister *s_buckhe [at] cs.uni-kl.de*
+Matthew Hall *mhall [at] mhcomputing.net*
----------------------------------------------------------------------
Copying and distribution of this file, with or without modification,
/* Check the hostname of the first certificate if it matches
* the name of the host we connected to.
*/
- if (gnutls_x509_crt_check_hostname (crt, hostname) == 0)
+ if (hostname != NULL)
{
- printf
+ if (gnutls_x509_crt_check_hostname (crt, hostname) == 0)
+ {
+ printf
("- The hostname in the certificate does NOT match '%s'\n",
hostname);
- ret = 0;
- }
- else
- {
- printf ("- The hostname in the certificate matches '%s'.\n",
- hostname);
- ret = 1;
+ ret = 0;
+ }
+ else
+ {
+ printf ("- The hostname in the certificate matches '%s'.\n",
+ hostname);
+ ret = 1;
+ }
}
gnutls_x509_crt_deinit (crt);