diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-03-02 15:40:49 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-03-02 15:40:49 +0100 |
commit | b5c7519d9a4449ffe9fadb6ba30f5295752bb97b (patch) | |
tree | 1a039cad855872d6561ab948c42667f809e0d10f | |
parent | 8093de995c3bce1735109cddcf521e28e36fd76d (diff) | |
download | libmicrohttpd-b5c7519d9a4449ffe9fadb6ba30f5295752bb97b.tar.gz libmicrohttpd-b5c7519d9a4449ffe9fadb6ba30f5295752bb97b.zip |
improve example on client cert validation, as suggested by Folkert van Heusden
-rw-r--r-- | doc/chapters/tlsauthentication.inc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/chapters/tlsauthentication.inc b/doc/chapters/tlsauthentication.inc index ebde69a8..90984feb 100644 --- a/doc/chapters/tlsauthentication.inc +++ b/doc/chapters/tlsauthentication.inc | |||
@@ -187,6 +187,13 @@ get_client_certificate (gnutls_session_t tls_session) | |||
187 | if (gnutls_certificate_verify_peers2(tls_session, | 187 | if (gnutls_certificate_verify_peers2(tls_session, |
188 | &client_cert_status)) | 188 | &client_cert_status)) |
189 | return NULL; | 189 | return NULL; |
190 | if (0 != client_cert_status) | ||
191 | { | ||
192 | fprintf (stderr, | ||
193 | "Failed client certificate invalid: %d\n", | ||
194 | client_cert_status); | ||
195 | return NULL; | ||
196 | } | ||
190 | pcert = gnutls_certificate_get_peers(tls_session, | 197 | pcert = gnutls_certificate_get_peers(tls_session, |
191 | &listsize); | 198 | &listsize); |
192 | if ( (pcert == NULL) || | 199 | if ( (pcert == NULL) || |