mirror of https://github.com/moparisthebest/curl
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.
This commit is contained in:
parent
277022b2e4
commit
db4f69ef06
|
@ -354,8 +354,12 @@ static CURLcode imap_state_starttls_resp(struct connectdata *conn,
|
||||||
(void)instate; /* no use for this yet */
|
(void)instate; /* no use for this yet */
|
||||||
|
|
||||||
if(imapcode != 'O') {
|
if(imapcode != 'O') {
|
||||||
failf(data, "STARTTLS denied. %c", imapcode);
|
if(data->set.use_ssl != CURLUSESSL_TRY) {
|
||||||
result = CURLE_USE_SSL_FAILED;
|
failf(data, "STARTTLS denied. %c", imapcode);
|
||||||
|
result = CURLE_USE_SSL_FAILED;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
result = imap_state_login(conn);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(data->state.used_interface == Curl_if_multi) {
|
if(data->state.used_interface == Curl_if_multi) {
|
||||||
|
|
10
lib/pop3.c
10
lib/pop3.c
|
@ -298,9 +298,13 @@ static CURLcode pop3_state_starttls_resp(struct connectdata *conn,
|
||||||
(void)instate; /* no use for this yet */
|
(void)instate; /* no use for this yet */
|
||||||
|
|
||||||
if(pop3code != 'O') {
|
if(pop3code != 'O') {
|
||||||
failf(data, "STARTTLS denied. %c", pop3code);
|
if(data->set.use_ssl != CURLUSESSL_TRY) {
|
||||||
result = CURLE_USE_SSL_FAILED;
|
failf(data, "STARTTLS denied. %c", pop3code);
|
||||||
state(conn, POP3_STOP);
|
result = CURLE_USE_SSL_FAILED;
|
||||||
|
state(conn, POP3_STOP);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
result = pop3_state_user(conn);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* Curl_ssl_connect is BLOCKING */
|
/* Curl_ssl_connect is BLOCKING */
|
||||||
|
|
Loading…
Reference in New Issue