GnuTLS: fix 'time_appconnect' for early data

When using early data with GnuTLS, the the timer `appconnect`
had the value from the "pretended" connect, not when the actual
TLS handshake was done.

Closes #15954
This commit is contained in:
Stefan Eissing 2025-01-09 13:09:50 +01:00 committed by Daniel Stenberg
parent a19b759dea
commit 533dc84e6e
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 5 additions and 1 deletions

View File

@ -1969,6 +1969,9 @@ gtls_connect_common(struct Curl_cfilter *cf,
goto out;
if(connssl->earlydata_state == ssl_earlydata_sent) {
/* report the true time the handshake was done */
connssl->handshake_done = Curl_now();
Curl_pgrsTimeWas(data, TIMER_APPCONNECT, connssl->handshake_done);
if(gnutls_session_get_flags(backend->gtls.session) &
GNUTLS_SFLAGS_EARLY_DATA) {
connssl->earlydata_state = ssl_earlydata_accepted;

View File

@ -1386,7 +1386,8 @@ static CURLcode ssl_cf_connect(struct Curl_cfilter *cf,
if(!result && *done) {
cf->connected = TRUE;
connssl->handshake_done = Curl_now();
if(connssl->state == ssl_connection_complete)
connssl->handshake_done = Curl_now();
/* Connection can be deferred when sending early data */
DEBUGASSERT(connssl->state == ssl_connection_complete ||
connssl->state == ssl_connection_deferred);