]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Fixed use of CURLUSESSL_TRY for POP3 and IMAP based connections.
authorSteve Holme <steve_holme@hotmail.com>
Tue, 3 Jan 2012 23:17:08 +0000 (23:17 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 3 Jan 2012 23:48:20 +0000 (00:48 +0100)
Fixed a problem in POP3 and IMAP where a connection would fail when
CURLUSESSL_TRY was specified for a server that didn't support
SSL/TLS connections rather than continuing.

lib/imap.c
lib/pop3.c

index ba6c61078adf51a6e95ac7c78a2fd0e77641b129..c39664d86d775abf99f3de369c992d8b1f2ff339 100644 (file)
@@ -354,8 +354,12 @@ static CURLcode imap_state_starttls_resp(struct connectdata *conn,
   (void)instate; /* no use for this yet */
 
   if(imapcode != 'O') {
-    failf(data, "STARTTLS denied. %c", imapcode);
-    result = CURLE_USE_SSL_FAILED;
+    if(data->set.use_ssl != CURLUSESSL_TRY) {
+      failf(data, "STARTTLS denied. %c", imapcode);
+      result = CURLE_USE_SSL_FAILED;
+    }
+    else
+      result = imap_state_login(conn);
   }
   else {
     if(data->state.used_interface == Curl_if_multi) {
index 283025120c2e02f3e1b06edd65816397f99c9222..b7781109b3816d2be7b0193d2417fe6f5c8378c0 100644 (file)
@@ -298,9 +298,13 @@ static CURLcode pop3_state_starttls_resp(struct connectdata *conn,
   (void)instate; /* no use for this yet */
 
   if(pop3code != 'O') {
-    failf(data, "STARTTLS denied. %c", pop3code);
-    result = CURLE_USE_SSL_FAILED;
-    state(conn, POP3_STOP);
+    if(data->set.use_ssl != CURLUSESSL_TRY) {
+      failf(data, "STARTTLS denied. %c", pop3code);
+      result = CURLE_USE_SSL_FAILED;
+      state(conn, POP3_STOP);
+    }
+    else
+      result = pop3_state_user(conn);
   }
   else {
     /* Curl_ssl_connect is BLOCKING */