mirror of
https://github.com/moparisthebest/curl
synced 2025-01-04 18:38:03 -05:00
nss: reset SSL handshake state machine
... when the handshake succeeds This fixes a connection failure when FTPS handle is reused.
This commit is contained in:
parent
8ed66f98a9
commit
0aecdf6828
@ -34,6 +34,7 @@ This release includes the following bugfixes:
|
|||||||
o Cmake: Avoid cycle directory dependencies
|
o Cmake: Avoid cycle directory dependencies
|
||||||
o Cmake: Build with GSSAPI (MIT or Heimdal)
|
o Cmake: Build with GSSAPI (MIT or Heimdal)
|
||||||
o vtls: provide backend defines for internal source code
|
o vtls: provide backend defines for internal source code
|
||||||
|
o nss: fix a connection failure when FTPS handle is reused
|
||||||
|
|
||||||
This release includes the following known bugs:
|
This release includes the following known bugs:
|
||||||
|
|
||||||
|
@ -1482,9 +1482,6 @@ static CURLcode nss_setup_connect(struct connectdata *conn, int sockindex)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if(connssl->state == ssl_connection_complete)
|
|
||||||
return CURLE_OK;
|
|
||||||
|
|
||||||
connssl->data = data;
|
connssl->data = data;
|
||||||
|
|
||||||
/* list of all NSS objects we need to destroy in Curl_nss_close() */
|
/* list of all NSS objects we need to destroy in Curl_nss_close() */
|
||||||
@ -1749,10 +1746,6 @@ static CURLcode nss_do_connect(struct connectdata *conn, int sockindex)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
connssl->state = ssl_connection_complete;
|
|
||||||
conn->recv[sockindex] = nss_recv;
|
|
||||||
conn->send[sockindex] = nss_send;
|
|
||||||
|
|
||||||
display_conn_info(conn, connssl->handle);
|
display_conn_info(conn, connssl->handle);
|
||||||
|
|
||||||
if(data->set.str[STRING_SSL_ISSUERCERT]) {
|
if(data->set.str[STRING_SSL_ISSUERCERT]) {
|
||||||
@ -1788,6 +1781,9 @@ static CURLcode nss_connect_common(struct connectdata *conn, int sockindex,
|
|||||||
const bool blocking = (done == NULL);
|
const bool blocking = (done == NULL);
|
||||||
CURLcode rv;
|
CURLcode rv;
|
||||||
|
|
||||||
|
if(connssl->state == ssl_connection_complete)
|
||||||
|
return CURLE_OK;
|
||||||
|
|
||||||
if(connssl->connecting_state == ssl_connect_1) {
|
if(connssl->connecting_state == ssl_connect_1) {
|
||||||
rv = nss_setup_connect(conn, sockindex);
|
rv = nss_setup_connect(conn, sockindex);
|
||||||
if(rv)
|
if(rv)
|
||||||
@ -1827,7 +1823,12 @@ static CURLcode nss_connect_common(struct connectdata *conn, int sockindex,
|
|||||||
/* signal completed SSL handshake */
|
/* signal completed SSL handshake */
|
||||||
*done = TRUE;
|
*done = TRUE;
|
||||||
|
|
||||||
connssl->connecting_state = ssl_connect_done;
|
connssl->state = ssl_connection_complete;
|
||||||
|
conn->recv[sockindex] = nss_recv;
|
||||||
|
conn->send[sockindex] = nss_send;
|
||||||
|
|
||||||
|
/* ssl_connect_done is never used outside, go back to the initial state */
|
||||||
|
connssl->connecting_state = ssl_connect_1;
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user