last_alert = gnutls_alert_get(session);
/* The check for renegotiation is only useful if we are
- * a client, and should be removed otherwise.
+ * a server, and we had requested a rehandshake.
*/
if (last_alert == GNUTLS_A_NO_RENEGOTIATION &&
ret == GNUTLS_E_WARNING_ALERT_RECEIVED)
}
if ( gnutls_certificate_expiration_time_peers(session) < time(0)) {
- printf("The certificate is expired\n");
+ printf("The certificate has expired\n");
return;
}
\par HTTPS clients have to verify not only the peer's certificate,
but also the hostname in this certificate. That is to know that
they actually connected to the right site.
-RFC2818 specifies some hostname checking algorithm, and this --a simple form--
-is implemented in the following example.
\par
-This function should be called right after a successful
-\printfunc{gnutls_certificate_verify_peers}{gnutls\_certificate\_verify\_peers}.
-See also
-\printfunc{gnutls_x509_check_certificates_hostname}{gnutls\_x509\_check\_certificates\_hostname}.
+The following function is an example on how to fully verify a certificate.
\input{ex-rfc2818}
* the given hostname. This is a basic implementation of the matching described
* in RFC2818 (HTTPS).
*
+ * Returns 1 on success, and 0 on failure.
+ *
**/
int gnutls_x509_check_certificates_hostname(const gnutls_datum * cert,
const char *hostname)