Skip to content

CURLINFO_TLS_SSL_PTR testing#18066

Closed
icing wants to merge 4 commits intocurl:masterfrom
icing:ssl-ptr-test
Closed

CURLINFO_TLS_SSL_PTR testing#18066
icing wants to merge 4 commits intocurl:masterfrom
icing:ssl-ptr-test

Conversation

@icing
Copy link
Contributor

@icing icing commented Jul 28, 2025

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.

@github-actions github-actions bot added the tests label Jul 28, 2025
@vszakats vszakats self-assigned this Jul 28, 2025
vszakats pushed a commit to vszakats/curl that referenced this pull request Jul 28, 2025
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.

Closes curl#18066
vszakats added a commit that referenced this pull request Jul 29, 2025
For libcurl API tests that need interacting directly with TLS-backends.

Partial revert of 58b9c61 #17696 for
cmake, and implementing the same for autotools.

Ref: #18066
Closes #18069
@vszakats
Copy link
Member

Pushed a fix for an empty switch() reported by VS2022,
and rebased on 4cce314 #18069 to adjust the builds.

@vszakats vszakats removed their assignment Jul 29, 2025
icing and others added 3 commits July 30, 2025 03:49
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.
VS2022 compiler warning:
```
tests\client\hx_download.c(199,7): warning C4065: switch statement contains 'default' but no 'case' labels
```
https://ci.appveyor.com/project/curlorg/curl/builds/52476876/job/axqek5whkn3q69s7#L257
AM Alpine MUSL https-rr c-ares:
```
../../../lib/memdebug.h:40:59: error: expected declaration specifiers or '...' before numeric constant
   40 | #define calloc(nbelem,size) curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
      |                                                           ^~~~~~~~
../../../lib/memdebug.h:40:69: error: expected declaration specifiers or '...' before string constant
   40 | #define calloc(nbelem,size) curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
      |                                                                     ^~~~~~~~
../../../lib/memdebug.h:44:38: error: expected declaration specifiers or '...' before numeric constant
   44 | #define free(ptr) curl_dbg_free(ptr, __LINE__, __FILE__)
      |                                      ^~~~~~~~
../../../lib/memdebug.h:44:48: error: expected declaration specifiers or '...' before string constant
   44 | #define free(ptr) curl_dbg_free(ptr, __LINE__, __FILE__)
      |                                                ^~~~~~~~
```
https://github.com/curl/curl/actions/runs/16610859929/job/46993519059?pr=18066#step:38:59
@vszakats
Copy link
Member

vszakats commented Jul 30, 2025

After rebasing to the clients+libtests merge in master, this PR
triggered a system function override issue in Alpine MUSL, this
time in tests. It was a theoretical case before, and the TLS
headers in this PR finally triggered it. As anticipated here earlier:
#17827 (comment)

I merged a fix for cli_hx_download.c in this PR, while working
on a solution for all tests in #17865.

@icing icing requested a review from bagder July 31, 2025 09:57
@icing
Copy link
Contributor Author

icing commented Jul 31, 2025

Thanks @vszakats for fixing this so quickly!

@bagder bagder closed this in ba9ddb9 Aug 1, 2025
vszakats added a commit that referenced this pull request Feb 11, 2026
Fixes:
```
$ wine libtests.exe cli_hx_download https://curl.se/
[...]
Assertion failed: t->checked_ssl, file .../curl/tests/libtest/cli_hx_download.c, line 563
```

into:
```
[t-0] info Schannel TLS version 0x00000800
```

Refs:
https://learn.microsoft.com/windows/win32/secauthn/querycontextattributes--general
https://learn.microsoft.com/windows/win32/api/schannel/ns-schannel-secpkgcontext_connectioninfo

Ref: c220674 #20564
Follow-up to ba9ddb9 #18066

Closes #20556
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants