Commit db4f69ef authored by Steve Holme's avatar Steve Holme Committed by Daniel Stenberg
Browse files

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.
parent 277022b2
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -354,9 +354,13 @@ static CURLcode imap_state_starttls_resp(struct connectdata *conn,
  (void)instate; /* no use for this yet */

  if(imapcode != 'O') {
    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) {
      state(conn, IMAP_UPGRADETLS);
+7 −3
Original line number Diff line number Diff line
@@ -298,10 +298,14 @@ static CURLcode pop3_state_starttls_resp(struct connectdata *conn,
  (void)instate; /* no use for this yet */

  if(pop3code != 'O') {
    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 */
    result = Curl_ssl_connect(conn, FIRSTSOCKET);