Loading lib/imap.c +15 −4 Original line number Diff line number Diff line Loading @@ -459,6 +459,20 @@ static void state(struct connectdata *conn, imapstate newstate) imapc->state = newstate; } static CURLcode imap_state_starttls(struct connectdata *conn) { CURLcode result = CURLE_OK; const char *str = getcmdid(conn); /* Send the STARTTLS command */ result = imap_sendf(conn, str, "%s STARTTLS", str); if(!result) state(conn, IMAP_STARTTLS); return result; } static CURLcode imap_state_capability(struct connectdata *conn) { CURLcode result = CURLE_OK; Loading Loading @@ -608,10 +622,7 @@ static CURLcode imap_state_servergreet_resp(struct connectdata *conn, if(data->set.use_ssl && !conn->ssl[FIRSTSOCKET].use) { /* We don't have a SSL/TLS connection yet, but SSL is requested. Switch to TLS connection now */ const char *str = getcmdid(conn); result = imap_sendf(conn, str, "%s STARTTLS", str); if(!result) state(conn, IMAP_STARTTLS); result = imap_state_starttls(conn); } else result = imap_state_capability(conn); Loading lib/pop3.c +14 −4 Original line number Diff line number Diff line Loading @@ -372,6 +372,19 @@ static void state(struct connectdata *conn, pop3state newstate) pop3c->state = newstate; } static CURLcode pop3_state_starttls(struct connectdata *conn) { CURLcode result = CURLE_OK; /* Send the STLS command */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "STLS"); if(!result) state(conn, POP3_STARTTLS); return result; } static CURLcode pop3_state_capa(struct connectdata *conn) { CURLcode result = CURLE_OK; Loading Loading @@ -541,7 +554,6 @@ static CURLcode pop3_state_servergreet_resp(struct connectdata *conn, { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct pop3_conn *pop3c = &conn->proto.pop3c; (void)instate; /* no use for this yet */ Loading @@ -553,9 +565,7 @@ static CURLcode pop3_state_servergreet_resp(struct connectdata *conn, if(data->set.use_ssl && !conn->ssl[FIRSTSOCKET].use) { /* We don't have a SSL/TLS connection yet, but SSL is requested. Switch to TLS connection now */ result = Curl_pp_sendf(&pop3c->pp, "STLS"); if(!result) state(conn, POP3_STARTTLS); result = pop3_state_starttls(conn); } else result = pop3_state_capa(conn); Loading lib/smtp.c +14 −3 Original line number Diff line number Diff line Loading @@ -355,6 +355,19 @@ static CURLcode smtp_state_helo(struct connectdata *conn) return CURLE_OK; } static CURLcode smtp_state_starttls(struct connectdata *conn) { CURLcode result = CURLE_OK; /* Send the STARTTLS command */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "STARTTLS"); if(!result) state(conn, SMTP_STARTTLS); return result; } static CURLcode smtp_authenticate(struct connectdata *conn) { CURLcode result = CURLE_OK; Loading Loading @@ -545,9 +558,7 @@ static CURLcode smtp_state_ehlo_resp(struct connectdata *conn, int smtpcode, else if(data->set.use_ssl && !conn->ssl[FIRSTSOCKET].use) { /* We don't have a SSL/TLS connection yet, but SSL is requested. Switch to TLS connection now */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "STARTTLS"); if(!result) state(conn, SMTP_STARTTLS); result = smtp_state_starttls(conn); } else result = smtp_authenticate(conn); Loading Loading
lib/imap.c +15 −4 Original line number Diff line number Diff line Loading @@ -459,6 +459,20 @@ static void state(struct connectdata *conn, imapstate newstate) imapc->state = newstate; } static CURLcode imap_state_starttls(struct connectdata *conn) { CURLcode result = CURLE_OK; const char *str = getcmdid(conn); /* Send the STARTTLS command */ result = imap_sendf(conn, str, "%s STARTTLS", str); if(!result) state(conn, IMAP_STARTTLS); return result; } static CURLcode imap_state_capability(struct connectdata *conn) { CURLcode result = CURLE_OK; Loading Loading @@ -608,10 +622,7 @@ static CURLcode imap_state_servergreet_resp(struct connectdata *conn, if(data->set.use_ssl && !conn->ssl[FIRSTSOCKET].use) { /* We don't have a SSL/TLS connection yet, but SSL is requested. Switch to TLS connection now */ const char *str = getcmdid(conn); result = imap_sendf(conn, str, "%s STARTTLS", str); if(!result) state(conn, IMAP_STARTTLS); result = imap_state_starttls(conn); } else result = imap_state_capability(conn); Loading
lib/pop3.c +14 −4 Original line number Diff line number Diff line Loading @@ -372,6 +372,19 @@ static void state(struct connectdata *conn, pop3state newstate) pop3c->state = newstate; } static CURLcode pop3_state_starttls(struct connectdata *conn) { CURLcode result = CURLE_OK; /* Send the STLS command */ result = Curl_pp_sendf(&conn->proto.pop3c.pp, "STLS"); if(!result) state(conn, POP3_STARTTLS); return result; } static CURLcode pop3_state_capa(struct connectdata *conn) { CURLcode result = CURLE_OK; Loading Loading @@ -541,7 +554,6 @@ static CURLcode pop3_state_servergreet_resp(struct connectdata *conn, { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; struct pop3_conn *pop3c = &conn->proto.pop3c; (void)instate; /* no use for this yet */ Loading @@ -553,9 +565,7 @@ static CURLcode pop3_state_servergreet_resp(struct connectdata *conn, if(data->set.use_ssl && !conn->ssl[FIRSTSOCKET].use) { /* We don't have a SSL/TLS connection yet, but SSL is requested. Switch to TLS connection now */ result = Curl_pp_sendf(&pop3c->pp, "STLS"); if(!result) state(conn, POP3_STARTTLS); result = pop3_state_starttls(conn); } else result = pop3_state_capa(conn); Loading
lib/smtp.c +14 −3 Original line number Diff line number Diff line Loading @@ -355,6 +355,19 @@ static CURLcode smtp_state_helo(struct connectdata *conn) return CURLE_OK; } static CURLcode smtp_state_starttls(struct connectdata *conn) { CURLcode result = CURLE_OK; /* Send the STARTTLS command */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "STARTTLS"); if(!result) state(conn, SMTP_STARTTLS); return result; } static CURLcode smtp_authenticate(struct connectdata *conn) { CURLcode result = CURLE_OK; Loading Loading @@ -545,9 +558,7 @@ static CURLcode smtp_state_ehlo_resp(struct connectdata *conn, int smtpcode, else if(data->set.use_ssl && !conn->ssl[FIRSTSOCKET].use) { /* We don't have a SSL/TLS connection yet, but SSL is requested. Switch to TLS connection now */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "STARTTLS"); if(!result) state(conn, SMTP_STARTTLS); result = smtp_state_starttls(conn); } else result = smtp_authenticate(conn); Loading