]> granicus.if.org Git - curl/commitdiff
Fixed incorrect error code being returned in STARTTLS
authorSteve Holme <steve_holme@hotmail.com>
Tue, 3 Jan 2012 23:01:51 +0000 (23:01 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 3 Jan 2012 23:47:58 +0000 (00:47 +0100)
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
lib/pop3.c
lib/smtp.c

index c98730cb591efcd8f3d17434ff7f42147019fa2c..ba6c61078adf51a6e95ac7c78a2fd0e77641b129 100644 (file)
@@ -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) {
index 6796cf76f374fc32e78d5a07a872dc1cac0ea907..283025120c2e02f3e1b06edd65816397f99c9222 100644 (file)
@@ -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 {
index 7512f1d0a42d8e3efb7644880c4810fa3c41578a..4cb25efcaee40aa06f78afa1f9d5a458d2add4dd 100644 (file)
@@ -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);