wmbiff: added support for TLS SNI.

From Debian bug #917993:

  From: Nye Liu <nyet@nyet.org>
  Subject: wmbiff: gmail (and many other IMAP servers) now require SNI
  Date: Tue, 01 Jan 2019 18:33:51 -0800

  wmbiff/gmail imap4: Need new connection to ***@gmail.com@imap.gmail.com
  wmbiff/gmail comm: certificate passed time check.
  wmbiff/gmail comm: server's certificate (OU=No SNI provided\; please fix your client.,CN=invalid2.invalid) does not match its hostname (imap.gmail.com).
  wmbiff/gmail comm: server's certificate does not match its hostname.
  wmbiff/gmail comm: to ignore this error, run wmbiff with the -skip-certificate-check option

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
This commit is contained in:
Jeremy Sowden 2019-07-23 15:33:20 +01:00 committed by Carlos R. Mafra
parent 241ad5eae9
commit 0ad05f5d78

View file

@ -597,6 +597,8 @@ struct connection_state *initialize_gnutls(intptr_t sd, char *name, Pop3 *pc,
}
}
gnutls_server_name_set(scs->tls_state, GNUTLS_NAME_DNS,
remote_hostname, strlen(remote_hostname));
gnutls_cred_set(scs->tls_state, GNUTLS_CRD_CERTIFICATE,
scs->xcred);
gnutls_transport_set_ptr(scs->tls_state,