commit b5c7519d9a4449ffe9fadb6ba30f5295752bb97b
parent 8093de995c3bce1735109cddcf521e28e36fd76d
Author: Christian Grothoff <christian@grothoff.org>
Date: Tue, 2 Mar 2021 15:40:49 +0100
improve example on client cert validation, as suggested by Folkert van Heusden
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/doc/chapters/tlsauthentication.inc b/doc/chapters/tlsauthentication.inc
@@ -187,6 +187,13 @@ get_client_certificate (gnutls_session_t tls_session)
if (gnutls_certificate_verify_peers2(tls_session,
&client_cert_status))
return NULL;
+ if (0 != client_cert_status)
+ {
+ fprintf (stderr,
+ "Failed client certificate invalid: %d\n",
+ client_cert_status);
+ return NULL;
+ }
pcert = gnutls_certificate_get_peers(tls_session,
&listsize);
if ( (pcert == NULL) ||