summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2012-01-03 23:17:08 +0000
committerDaniel Stenberg <daniel@haxx.se>2012-01-04 00:48:20 +0100
commitdb4f69ef0630001e6d566b949d86d1739bdd85b3 (patch)
treecf65ac426b8750b67f8081d40671387fac729488
parent277022b2e48e338ca85adc4321f0cf5661df4713 (diff)
downloadcurl-db4f69ef0630001e6d566b949d86d1739bdd85b3.tar.gz
Fixed use of CURLUSESSL_TRY for POP3 and IMAP based connections.
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.
-rw-r--r--lib/imap.c8
-rw-r--r--lib/pop3.c10
2 files changed, 13 insertions, 5 deletions
diff --git a/lib/imap.c b/lib/imap.c
index ba6c61078..c39664d86 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -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) {
diff --git a/lib/pop3.c b/lib/pop3.c
index 283025120..b7781109b 100644
--- a/lib/pop3.c
+++ b/lib/pop3.c
@@ -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 */