GnuTLS: fix the advertising of acceptable certs by the server. Bug 2389
[exim.git] / src / src / tls-gnu.c
index 746eabfdeb4f6f9411afef84f8fd6153006f4788..867dbbe3dd8a438bcb1a951011068c39ab30e8d3 100644 (file)
@@ -1136,6 +1136,14 @@ else
 #endif
     gnutls_certificate_set_x509_trust_file(state->x509_cred,
       CS state->exp_tls_verify_certificates, GNUTLS_X509_FMT_PEM);
+
+#ifdef SUPPORT_CA_DIR
+  /* Mimic the behaviour with OpenSSL of not advertising a usable-cert list
+  when using the directory-of-certs config model. */
+
+  if ((statbuf.st_mode & S_IFMT) == S_IFDIR)
+    gnutls_certificate_send_x509_rdn_sequence(state->session, 1);
+#endif
   }
 
 if (cert_count < 0)