summaryrefslogtreecommitdiffstats
path: root/dirmngr
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2017-03-17 12:46:09 +0100
committerWerner Koch <wk@gnupg.org>2017-03-17 12:50:35 +0100
commit69c521df422a6c9a6b0a93e45c9373a8b6ceb28e (patch)
treef645dc1a74e94b9202be9e8550efea1e9d1522fe /dirmngr
parentgpgscm: Simplify hash tables. (diff)
downloadgnupg2-69c521df422a6c9a6b0a93e45c9373a8b6ceb28e.tar.xz
gnupg2-69c521df422a6c9a6b0a93e45c9373a8b6ceb28e.zip
dirmngr: Ignore warning alerts in the GNUTLS handshake.
* dirmngr/http.c (send_request) [GNUTLS]: Don't bail out on warning alerts. -- GnuPG-bug-id: 2833 Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'dirmngr')
-rw-r--r--dirmngr/http.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/dirmngr/http.c b/dirmngr/http.c
index 3adf6e51e..04a30d6b4 100644
--- a/dirmngr/http.c
+++ b/dirmngr/http.c
@@ -1903,6 +1903,7 @@ send_request (http_t hd, const char *httphost, const char *auth,
gnutls_transport_set_push_function (hd->session->tls_session,
my_gnutls_write);
+ handshake_again:
do
{
rc = gnutls_handshake (hd->session->tls_session);
@@ -1918,10 +1919,15 @@ send_request (http_t hd, const char *httphost, const char *auth,
alertno = gnutls_alert_get (hd->session->tls_session);
alertstr = gnutls_alert_get_name (alertno);
- log_info ("TLS handshake failed: %s (alert %d)\n",
+ log_info ("TLS handshake %s: %s (alert %d)\n",
+ rc == GNUTLS_E_WARNING_ALERT_RECEIVED
+ ? "warning" : "failed",
alertstr, (int)alertno);
if (alertno == GNUTLS_A_UNRECOGNIZED_NAME && server)
log_info (" (sent server name '%s')\n", server);
+
+ if (rc == GNUTLS_E_WARNING_ALERT_RECEIVED)
+ goto handshake_again;
}
else
log_info ("TLS handshake failed: %s\n", gnutls_strerror (rc));