]> granicus.if.org Git - neomutt/commitdiff
Add SNI support for GnuTLS. (closes #3923)
authorKevin McCarthy <kevin@8t8.us>
Thu, 9 Mar 2017 21:38:30 +0000 (13:38 -0800)
committerKevin McCarthy <kevin@8t8.us>
Thu, 9 Mar 2017 21:38:30 +0000 (13:38 -0800)
mutt_ssl_gnutls.c

index 2084ad04e0ca2ef27d77e7c57b336cd539adc898..121f2df5eabdd74692a3a0127a87261b0b51fcd9 100644 (file)
@@ -417,6 +417,13 @@ static int tls_negotiate (CONNECTION * conn)
   /* set socket */
   gnutls_transport_set_ptr (data->state, (gnutls_transport_ptr_t)(long)conn->fd);
 
+  if (gnutls_server_name_set (data->state, GNUTLS_NAME_DNS, conn->account.host,
+                              mutt_strlen (conn->account.host)))
+  {
+    mutt_error _("Warning: unable to set TLS SNI host name");
+    mutt_sleep (1);
+  }
+
   if (tls_set_priority(data) < 0) {
     goto fail;
   }