]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
GnuTLS: Always send client cert
authorjethrogb <github@jbeekman.nl>
Thu, 20 Feb 2020 19:36:25 +0000 (20:36 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 21 Feb 2020 14:33:36 +0000 (15:33 +0100)
TLS servers may request a certificate from the client. This request
includes a list of 0 or more acceptable issuer DNs. The client may use
this list to determine which certificate to send. GnuTLS's default
behavior is to not send a client certificate if there is no
match. However, OpenSSL's default behavior is to send the configured
certificate. The `GNUTLS_FORCE_CLIENT_CERT` flag mimics OpenSSL
behavior.

Authored-by: jethrogb on github
Fixes #1411
Closes #4958

lib/vtls/gtls.c

index 3737d7c685ae2d413ff5c60be2ae6f83a2e8dd2e..955f1ee3507c0d0ca8e93a58f1e5d35fd989a520 100644 (file)
@@ -664,7 +664,7 @@ gtls_connect_step1(struct connectdata *conn,
   }
 
   /* Initialize TLS session as a client */
-  init_flags = GNUTLS_CLIENT;
+  init_flags = GNUTLS_CLIENT | GNUTLS_FORCE_CLIENT_CERT;
 
 #if defined(GNUTLS_NO_TICKETS)
   /* Disable TLS session tickets */