Repository navigation
Prioritize loading OpenSSL 4.x - #137823
Merged
Merged
Conversation
|
Azure Pipelines: Successfully started running 3 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security |
bartonjs
approved these changes
Nov 18, 2026
rzikm
added a commit
that referenced
this pull request
Nov 24, 2026
<!-- --> Prioritizing OpenSSL 4 in #137823 exposed two compatibility failures in RSA-padding configuration and post-handshake client authentication. The same Ubuntu 26.10 image previously passed the affected cases with OpenSSL 3. - Map the advertised SM2 signature scheme (`0x0708`) to `sm2sig_sm3`. The fallback string `0x0708` is rejected by OpenSSL 4.0.3, causing signature-list configuration to fail before authentication completes. Add a four-case theory covering the RSA-padding combinations. - Treat failures from `SSL_verify_client_post_handshake` and `SSL_renegotiate` as error-queue failures rather than querying `SSL_get_error`. These APIs schedule work, rather than perform I/O. OpenSSL 4 no longer consults the error stack in `SSL_get_error`, so the old code could return a previous `WANT_READ` and lose the queued failure reason. The [PHA documentation](https://docs.openssl.org/4.0/man3/SSL_CTX_set_verify/#return-values) explicitly directs callers to the error stack; the [SSL_get_error documentation](https://docs.openssl.org/4.0/man3/SSL_get_error/) describes its I/O-only contract and the OpenSSL 4 change. Reporting `SSL_ERROR_SSL` from our shim routes the failure through existing queue decoding. The actual `SSL_R_EXTENSION_NOT_RECEIVED` reason and its `NoRenegotiation` mapping remain unchanged. ## Validation Built and tested Linux x64 in WSL using the exact CI image's OpenSSL 4.0.3 and 3.5.5 libraries, selected with `LD_LIBRARY_PATH` and `DOTNET_OPENSSL_VERSION_OVERRIDE`. Verified the loaded library versions. | Command | Result | | --- | --- | | `./build.sh clr+libs -rc release` | Passed | | `./dotnet.sh build src/native/libs/build-native.proj -p:RuntimeConfiguration=Release` | Passed | | `./dotnet.sh build src/libraries/System.Net.Security/src/System.Net.Security.csproj -p:RuntimeConfiguration=Release` | Passed | | `./dotnet.sh build src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj /t:Test -p:RuntimeConfiguration=Release` | Both OpenSSL versions: 5,164 passed, 0 failed, 8 skipped | | `./dotnet.sh build src/libraries/System.Net.Security/tests/UnitTests/System.Net.Security.Unit.Tests.csproj /t:Test -p:RuntimeConfiguration=Release` | Both versions: 129 passed, 1 pre-existing failure, 12 skipped | All eight affected RSA/PHA cases pass on both versions. Before the fix, the new signature theory failed all four cases and both affected PHA tests failed on OpenSSL 4. All nine existing error-layout theory cases still pass. The unit failure is `NegotiateAuthenticationTests.Package_Unsupported_NTLM` (expected `Unsupported`, actual `ContinueNeeded`). Rebuilt pristine source and reproduced that same failure on both OpenSSL versions: 125 passed, 1 failed, 12 skipped. No assertions were relaxed or tests disabled. Validation used the extracted libraries, not a complete CI-container run. OpenSSL 1.x/4.1 and other platforms were not tested. > [!NOTE] > These code changes and this PR description were prepared with GitHub Copilot. Co-authored-by: Copilot App <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenSSL 3.x was preferentially loaded before 4.x because at the time 4.x was not stable. That is no longer true, so lets' probe for OpenSSL 4.x first, and prefer it if both are present.
The OpenBSD and FreeBSD SO names were not present for OpenSSL 4.1 from Ports, so let's catch them up.
Recall that OpenBSD loads by directory name, not by an SONAME suffix, then by highest SHLIBVER in the directory.
OpenSSL from 3.6 via Ports was also missing, so let's add it. It's no longer supported, but FreeBSD still has it with an SONAME suffix of 18. https://cgit.freebsd.org/ports/plain/security/openssl36/version.mk