Explorar o código

improve example on client cert validation, as suggested by Folkert van Heusden

Christian Grothoff %!s(int64=5) %!d(string=hai) anos
pai
achega
b5c7519d9a
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      doc/chapters/tlsauthentication.inc

+ 7 - 0
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) ||