]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-common: Retrieve error from ssl context if handshake fails
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 26 Sep 2019 09:34:18 +0000 (12:34 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 26 Sep 2019 09:34:18 +0000 (12:34 +0300)
Fixes

imap-login: Error: proxy: Failed to start SSL handshake to 127.0.0.2:43143: (null)

and

imap-login: Error: Failed to initialize SSL server context: Can't load SSL certificate: error:140AB18F:SSL routines:SSL_CTX_use_certificate:ee key too small
Fatal: master: service(imap-login): child 14764 killed with signal 11 (core dumped)

Broken in 9f1038760ca5ba154366176a7056aad1c7b6c77e

src/login-common/login-proxy.c

index 2f69599a11e717084a60c616c63e6fdce0f7c2df..717481672eeafa0e0235864143bc8f744bf67e10 100644 (file)
@@ -716,6 +716,7 @@ int login_proxy_starttls(struct login_proxy *proxy)
        }
        ssl_iostream_context_unref(&ssl_ctx);
        if (ssl_iostream_handshake(proxy->server_ssl_iostream) < 0) {
+               error = ssl_iostream_get_last_error(proxy->server_ssl_iostream);
                client_log_err(proxy->client, t_strdup_printf(
                        "proxy: Failed to start SSL handshake to %s:%u: %s",
                        net_ip2addr(&proxy->ip), proxy->port, error));