X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=imap-send.c;h=d9bcfb44dc334d86363fd60b576fcc2e2121f971;hb=4fe3ed130201a95212dd18cb3bef104d44ed49c4;hp=43ac4e0bdfdba8850eff176b53d6bd071e8f424c;hpb=1d663835799f4c654fd46733e04fbaaaa0baf63a;p=~andy%2Fgit diff --git a/imap-send.c b/imap-send.c index 43ac4e0bd..d9bcfb44d 100644 --- a/imap-send.c +++ b/imap-send.c @@ -304,6 +304,17 @@ static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int ve return -1; } +#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME + /* + * SNI (RFC4366) + * OpenSSL does not document this function, but the implementation + * returns 1 on success, 0 on failure after calling SSLerr(). + */ + ret = SSL_set_tlsext_host_name(sock->ssl, server.host); + if (ret != 1) + warning("SSL_set_tlsext_host_name(%s) failed.", server.host); +#endif + ret = SSL_connect(sock->ssl); if (ret <= 0) { socket_perror("SSL_connect", sock, ret);