tls: CURLINFO_TLS_SSL_PTR testing

Add tests of CURLINFO_TLS_SSL_PTR and its returned value in test client
'hx-download'. Use obtained pointer to look up the negotiated TLS
version.

Update manpage of CURLINFO_TLS_SSL_PTR to also describe the behaviour of
wolfSSL similar to OpenSSL. Fix the wolfSSl implementation for TCP to
behave like that. Update the QUIC queries.

Fix rustls `get_internals()` to return the rustls_connection* and not
the address of the pointer.

Assisted-by: Viktor Szakats
Closes #18066
This commit is contained in:
Stefan Eissing 2025-07-23 11:21:36 +02:00 committed by Daniel Stenberg
parent af69c9d636
commit ba9ddb9357
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
7 changed files with 121 additions and 9 deletions

View file

@ -2658,7 +2658,7 @@ static CURLcode cf_ngtcp2_query(struct Curl_cfilter *cf,
case CF_QUERY_SSL_CTX_INFO: {
struct curl_tlssessioninfo *info = pres2;
if(Curl_vquic_tls_get_ssl_info(&ctx->tls,
(query == CF_QUERY_SSL_INFO), info))
(query == CF_QUERY_SSL_CTX_INFO), info))
return CURLE_OK;
break;
}

View file

@ -2352,7 +2352,7 @@ static CURLcode cf_osslq_query(struct Curl_cfilter *cf,
case CF_QUERY_SSL_CTX_INFO: {
struct curl_tlssessioninfo *info = pres2;
if(Curl_vquic_tls_get_ssl_info(&ctx->tls,
(query == CF_QUERY_SSL_INFO), info))
(query == CF_QUERY_SSL_CTX_INFO), info))
return CURLE_OK;
break;
}

View file

@ -1551,7 +1551,7 @@ static CURLcode cf_quiche_query(struct Curl_cfilter *cf,
case CF_QUERY_SSL_CTX_INFO: {
struct curl_tlssessioninfo *info = pres2;
if(Curl_vquic_tls_get_ssl_info(&ctx->tls,
(query == CF_QUERY_SSL_INFO), info))
(query == CF_QUERY_SSL_CTX_INFO), info))
return CURLE_OK;
break;
}

View file

@ -1300,7 +1300,7 @@ cr_get_internals(struct ssl_connect_data *connssl,
struct rustls_ssl_backend_data *backend =
(struct rustls_ssl_backend_data *)connssl->backend;
DEBUGASSERT(backend);
return &backend->conn;
return backend->conn;
}
static CURLcode

View file

@ -2240,12 +2240,12 @@ static CURLcode wssl_sha256sum(const unsigned char *tmp, /* input */
}
static void *wssl_get_internals(struct ssl_connect_data *connssl,
CURLINFO info UNUSED_PARAM)
CURLINFO info)
{
struct wssl_ctx *wssl = (struct wssl_ctx *)connssl->backend;
(void)info;
DEBUGASSERT(wssl);
return wssl->ssl;
return info == CURLINFO_TLS_SESSION ?
(void *)wssl->ssl_ctx : (void *)wssl->ssl;
}
const struct Curl_ssl Curl_ssl_wolfssl = {