From 277022b2e48e338ca85adc4321f0cf5661df4713 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Tue, 3 Jan 2012 23:01:51 +0000 Subject: Fixed incorrect error code being returned in STARTTLS The STARTTLS response code in SMTP, POP3 and IMAP would return CURLE_LOGIN_DENIED rather than CURLE_USE_SSL_FAILED when SSL/TLS was not available on the server. Reported by: Gokhan Sengun Bug: http://curl.haxx.se/mail/lib-2012-01/0018.html --- lib/imap.c | 2 +- lib/pop3.c | 2 +- lib/smtp.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/imap.c b/lib/imap.c index c98730cb5..ba6c61078 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -355,7 +355,7 @@ static CURLcode imap_state_starttls_resp(struct connectdata *conn, if(imapcode != 'O') { failf(data, "STARTTLS denied. %c", imapcode); - result = CURLE_LOGIN_DENIED; + result = CURLE_USE_SSL_FAILED; } else { if(data->state.used_interface == Curl_if_multi) { diff --git a/lib/pop3.c b/lib/pop3.c index 6796cf76f..283025120 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -299,7 +299,7 @@ static CURLcode pop3_state_starttls_resp(struct connectdata *conn, if(pop3code != 'O') { failf(data, "STARTTLS denied. %c", pop3code); - result = CURLE_LOGIN_DENIED; + result = CURLE_USE_SSL_FAILED; state(conn, POP3_STOP); } else { diff --git a/lib/smtp.c b/lib/smtp.c index 7512f1d0a..4cb25efca 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -510,7 +510,7 @@ static CURLcode smtp_state_starttls_resp(struct connectdata *conn, if(smtpcode != 220) { if(data->set.use_ssl != CURLUSESSL_TRY) { failf(data, "STARTTLS denied. %c", smtpcode); - result = CURLE_LOGIN_DENIED; + result = CURLE_USE_SSL_FAILED; } else result = smtp_authenticate(conn); -- cgit v1.2.3