Skip to content

[release/10.0] OpenSSL 4 support - #135534

Merged
artl93 merged 3 commits into
dotnet:release/10.0from
vcsjones:ossl4-support
Oct 10, 2026
Merged

artl93 merged 3 commits into
dotnet:release/10.0from
vcsjones:ossl4-support

Conversation

@vcsjones

@vcsjones vcsjones commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

This is conceptually a backport of #122744, #125470, and #125687.

It is a stripped-down version of it to make the minimum number of changes possible. Due to .NET 11 removing support for OpenSSL 1.0.x and 1.1.0, the back ports did not apply cleanly at all and required re-implementing.

This does not address the const build warnings that the .NET 11 version did address. There are a substantial number of warnings in release/10.0 on later compiler versions, many more beyond what the initial PRs addressed. To keep the PR as small as possible and reduce churn the pre-existing warnings remain.

There are two "main" places that differ from the .NET 11 changes

  1. CheckX509HostnameMatch needed to be fixed in .NET 10. It does not exist in .NET 11.
  2. ASN1_STRING_get0_data needed to be a FALLBACK shim for OpenSSL 1.0.2.

Customer Impact

  • Customer reported
  • Found internally

Reported by customers and partners at #125619. .NET 10 will fail to run on systems which contain only OpenSSL 4.0. Some linux distributions such as Ubuntu 26.10 and Fedora 45 intend to ship with OpenSSL 4.0, and .NET 10 will not run on them without these changes.

Regression

  • Yes
  • No

Testing

Verified locally with various OpenSSL versions, both portably and non-portably.

Risk

Medium-low. This brings changes to the runtime for OpenSSL versions which we lack CI coverage. The changes are generally straight forward.

Closes #125619

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security
See info in area-owners.md if you want to be subscribed.

@bartonjs bartonjs added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Oct 9, 2026
@bartonjs

bartonjs commented Oct 9, 2026

Copy link
Copy Markdown
Member

Servicing approved via email

@artl93

artl93 commented Oct 10, 2026

Copy link
Copy Markdown
Member

/ba-g on @bartonjs behalf

@artl93
artl93 merged commit 73ae276 into dotnet:release/10.0 Oct 10, 2026
99 of 118 checks passed
@vcsjones
vcsjones deleted the ossl4-support branch October 11, 2026 02:55
@hartwork

hartwork commented Nov 9, 2026

Copy link
Copy Markdown

Hi! Does this fix support for OpenSSL 4.1.0 also? Is there an ETA for a release with this pull request included? Thank you!

@wfurt

wfurt commented Nov 9, 2026

Copy link
Copy Markdown
Member

servicing is released monthly on patch Tuesday. If I'm not mistaken it should go out tomorrow @hartwork

@bartonjs

bartonjs commented Nov 9, 2026

Copy link
Copy Markdown
Member

Does this fix support for OpenSSL 4.1.0 also?

"Probably", but, considering that OpenSSL 4.1.0 released on October 23rd, and we merged this change on October 10th, we could not have tested with 4.1.0.

That said, testing main with 4.1.0 hasn't resulted in catastrophic failure. Hence "probably".

mjcheetham added a commit to git-ecosystem/git-credential-manager that referenced this pull request Nov 10, 2026
Arch's rolling repositories now supply OpenSSL 4, while the portable
.NET 10 SDK used by the source installer cannot load libssl.so.4.
Source builds abort before compiling GCM, even though the system's
openssl package is installed.

Install the OpenSSL 3 compatibility libraries alongside the system
OpenSSL package for Arch and CachyOS. This preserves the system's
OpenSSL 4 dependencies while satisfying the SDK's existing ABI
requirement.

The .NET 10 backport in
dotnet/runtime#135534
adds OpenSSL 4.x loading support. Once released and picked up by the
SDK/runtime used for source builds, it should make this compatibility
dependency unnecessary.

Assisted-by: GPT-6.1 Sol
Signed-off-by: Matthew John Cheetham <[email protected]>
mjcheetham added a commit to git-ecosystem/git-credential-manager that referenced this pull request Nov 10, 2026
Arch's rolling repositories now supply OpenSSL 4, while the portable
.NET 10 SDK used by the source installer cannot load libssl.so.4. Source
builds abort before compiling GCM, even though the system's openssl
package is installed.

Install the OpenSSL 3 compatibility libraries alongside the system
OpenSSL package for Arch and CachyOS. This preserves the system's
OpenSSL 4 dependencies while satisfying the SDK's existing ABI
requirement.

The .NET 10 backport in dotnet/runtime#135534
adds OpenSSL 4.x loading support. Once released and picked up by the
SDK/runtime used for source builds, it should make this compatibility
dependency unnecessary.
apprenticewiz added a commit to apprenticewiz/cparrott-overlay that referenced this pull request Nov 13, 2026
10.0.115 is the first 10.0 servicing release whose crypto shim builds
against OpenSSL 4 (dotnet/runtime#135534). 10.0.112 fails with
"incomplete definition of type 'ASN1_STRING'".

Bootstrap from 10.0.113 on amd64/arm64 (Microsoft), ppc64 (IBM) and
loong (Loongson, with their v10.0.115-loongarch64 delta). riscv stays on
10.0.112: AOSC has not published a 10.0.113 riscv64 SDK.

Build with TZ=UTC. NuGet stores UTC in the local-time fields of nupkg
entries, so west of UTC the SDK packages unpacked mid-build get future
mtimes, projects importing them keep rebuilding, and aspnetcore fails
with MSB3248 when a rebuilt DLL is copied while App.Ref is reading it.
evanspearman pushed a commit to evanspearman/pkgs that referenced this pull request Nov 25, 2026
…s 2026-11-01) (gominimal#1140)

* openssl: 4.1.0 (3.6 support ends 2026-11-01)

OpenSSL 3.6 is supported until 2026-11-01; 4.1 until Nov 2027
(openssl-library.org/source). sha256 is the release's published
openssl-4.1.0.tar.gz.sha256 (verified against a download).

4.x layout changes reflected in outputs:
- SHLIB_VERSION=4: libssl.so.4 / libcrypto.so.4. Every symbol is
  versioned OPENSSL_4.0.0, so it can coexist with libssl.so.3 from
  packages/openssl-3.5 in one process.
- c_rehash removed (use `openssl rehash`); dropped its output.
- ENGINE support removed: no engines-3 directory; dropped its output.
- ossl-modules now globs usr/lib/ossl-modules (it pointed at
  engines-3, so legacy.so was never shipped).

--openssldir=/etc/ssl, --libdir=lib, shared, zlib-dynamic unchanged;
all are still valid 4.x Configure options. build.sh now fails closed
if the .so.4 / ossl-modules layout is missing.

DRAFT, NOT PUSHED: the tarball is not yet mirrored to
gs://minimal-staging-archives/openssl/openssl/openssl-4.1.0.tar.gz.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* openssl-3.5: new compat package (3.5.9 LTS, libssl.so.3 beside 4.x)

OpenSSL 3.5 is the LTS line (supported to 2030-04-08). This package
ships its libssl.so.3 / libcrypto.so.3 on the default loader path and
a dev tree under /usr/lib/openssl-3.5, so code that cannot use 4.x keeps
working after packages/openssl moves to 4.1:

- rustc-1.98.1's stage0: both sealed rustc-1.97.1 bedrock tarballs ship
  a cargo with DT_NEEDED libssl.so.3 + libcrypto.so.3 (read from the
  amd64 and arm64 tarballs' ELF dynamic sections).
- actions-runner 2.336.0 bundles .NET 8 (global.json sdk 8.0.422); only
  .NET 10 got the OpenSSL 4 loader (dotnet/runtime#135534).
- foundationdb 7.3, whose C++ does not compile against 4.x's const X509
  API; upstream is itself moving to a pinned 3.5 (apple/foundationdb#14348).

Nothing collides with packages/openssl: no /usr/bin, /usr/include,
/usr/lib/pkgconfig or /etc/ssl files. OPENSSLDIR stays /etc/ssl, so the
CA store and openssl.cnf are shared. Symbol versions differ
(OPENSSL_3.x vs OPENSSL_4.0.0), so one process can load both.

The package name carries the series, so pkgmgr's name pin keeps it on
3.5.x. sha256 is the release's published openssl-3.5.9.tar.gz.sha256
(verified against a download). DRAFT, NOT PUSHED: not yet mirrored to
gs://minimal-staging-archives/openssl/openssl/openssl-3.5.9.tar.gz.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* rustc-1.98.1: give the bedrock stage0 its libssl.so.3 (openssl-3.5)

Both sealed rustc-1.97.1 bedrock tarballs (amd64 6ec57e96..., arm64
de0724a4...) ship usr/lib/rustc-1.97.1/bin/cargo with DT_NEEDED
libssl.so.3 and libcrypto.so.3. With packages/openssl on 4.x only
libssl.so.4 exists, so the stage0 cargo would fail to load and the rung,
packages/rust and every Rust package behind it would fail on both arches.

openssl-3.5 goes into the amd64 bedrock spec's runtime_deps and into the
rung's build_deps (the arm64 stage0 is a bare Source). The rung's own
cargo still builds against 4.x: its vendored openssl-sys is 0.9.117.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* actions-runner: runtime-depend on openssl-3.5 (bundled .NET 8 needs libssl.so.3)

actions-runner 2.336.0 bundles .NET 8 (src/global.json sdk 8.0.422).
Its System.Security.Cryptography.Native shim dlopens libssl.so.3 and has
no OpenSSL 4 (.so.4) support: the loader change was backported only to
.NET 10 (dotnet/runtime#135534, merged 2026-10-10; tracking issue
dotnet/runtime#125619 targets 12.0). Without libssl.so.3 every HTTPS
call the runner makes fails at run time once packages/openssl is 4.x.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* python: carry the OpenSSL 4 support for _ssl (cpython#149783, Modules/)

CPython 3.14 has no OpenSSL 4 support: the 3.14 backport,
python/cpython#149783 ("[3.14] gh-148292: Add OpenSSL 4 support"), was
closed unmerged pending 3.15.0 feedback. Unpatched, 3.14.10's _ssl.c
declares and calls SSLv3/TLSv1/TLSv1_1/TLSv1_2_method(), which 4.0
removed, so _ssl.so has unresolved symbols and the ssl module fails to
import.

The patch is the PR's Modules/ hunks (gh-146207 #146217, gh-148600
#148601, gh-148292 #149102, all merged on main): fixed-version methods
treated as absent on 4.x, const X509_NAME/ASN1_STRING accessors,
_ssl_data_40.h, and SSLEOFError bookkeeping for 4.x's EOF behaviour.
Arch Linux carries the same PR in its OpenSSL 4 rebuild. Each hunk is
guarded for 4.x or is a const qualifier, so it is a no-op on OpenSSL 3.
`git apply --check` against v3.14.10's files: applies, offsets only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* socat: ASN1_STRING accessors for OpenSSL 4

OpenSSL 4.0 made ASN1_STRING opaque. socat 1.8.1.3's
openssl_handle_peer_certificate() reads pName->d.iPAddress->data and
->length directly, a hard compile error on 4.x. Carry Debian's
1.8.1.3-2 patch (10-Use-OpenSSL-ASN1_STRING-accessor-functions...);
Fedora rawhide carries the identical hunk (socat-1.8.1.0-openssl4.patch).
Checked: applies cleanly to the mirrored tarball (sha256 06602ffd...).
No-op on OpenSSL 3. socat's fixed-version method calls are behind
configure HAVE_ checks, so they drop out on 4.x by themselves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* codex, sccache, zellij: lock openssl-sys 0.9.117 for OpenSSL 4

openssl-sys before 0.9.114 aborts in its build script on OpenSSL 4
("This crate is only compatible with OpenSSL (version 1.1.0, 1.1.1, or
3.x)"); 0.9.114 (2026-04-19) added 4.x. These three lock 0.9.111 and
build it against the system library:
- codex 0.164.0: openssl-sys via native-tls on linux-gnu (vendored only
  for musl). Arch hit the same panic: openai/codex#35404 (open).
- sccache 0.18.0: default "all" pulls native-tls; 0.19.0 still locks
  0.9.111. Arch: mozilla/sccache#2780.
- zellij 0.45.1: openssl-sys via isahc's vendored curl-sys, with
  OPENSSL_NO_VENDOR=1.

Each gets a hand-written Cargo.lock patch to openssl-sys 0.9.117 (and
openssl 0.10.81 where it is locked: codex, sccache), the pair Arch pins.
Checksums from the crates.io index; openssl 0.10.81 drops once_cell from
its dependencies, which other crates still use. Each patch was checked
with git apply against upstream's lock at the pinned tag (sccache and
zellij after their webpki lock patch). build.sh fails closed if
0.9.117 is not locked.

Already 4.x-ready, no change: atuin and cloud-hypervisor (0.9.117),
nushell and typst (0.9.116), gurk (no openssl-sys).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* foundationdb: build against openssl-3.5 (7.3 does not compile on OpenSSL 4)

FoundationDB 7.3.79's TLS code assigns X509_get_subject_name() /
X509_get_issuer_name() / X509_NAME_get_entry() / X509_NAME_ENTRY_get_data()
results to non-const pointers (flow/TLSConfig.actor.cpp: X509_NAME
*subject, *issuer; match_name_criteria / match_criteria_entry), and
flow/MkCert.cpp edits a certificate's subject name in place. All four
return const in OpenSSL 4, which is an error in C++. No upstream 4.x
fix exists; upstream is moving the other way, to a pinned 3.5 or
vendored OpenSSL (apple/foundationdb#14348, open).

So build against packages/openssl-3.5: explicit OPENSSL_* CMake cache
variables plus -I on CFLAGS/CXXFLAGS so no translation unit picks up the
4.x headers in /usr/include. build.sh fails closed unless fdbserver and
libfdb_c link libssl.so.3 and not libssl.so.4. Runtime dep switches
from openssl to openssl-3.5.

UNVERIFIED: not built. Header shadowing is the risk to watch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wget: guard SSLv3_client_method for OpenSSL 4

wget 1.25.0 guards the call with #ifndef OPENSSL_NO_SSL3_METHOD, but
OpenSSL 4 removed the function without defining that macro, so the world
build failed (implicit declaration, openssl.c:230). Also require OpenSSL < 4,
as wget already does for SSLv2. --secure-protocol=SSLv3 then gets no method
and fails cleanly, the same as SSLv2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* zellij: link the system libcurl instead of curl-sys's bundled curl 8.4.0

The world build failed on zellij (both arches): its default `vendored_curl`
feature (isahc/static-curl) compiles curl-sys's bundled curl 8.4.0, which
reads OpenSSL's now-opaque ASN1_INTEGER (vtls/openssl.c:455). Build the other
two default features only, so curl-sys links our libcurl (pkgconf + curl as
build deps, curl libs at runtime), and fail closed unless the binary NEEDs
libcurl.so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* curl: build with HTTP/2 (nghttp2), so curl-sys users link it on OpenSSL 4

zellij still compiled curl-sys's bundled curl 8.4.0 after dropping
vendored_curl: isahc requests http2, and curl-sys falls back to its bundled
copy when `curl-config --features` lacks HTTP2. Our curl had no nghttp2.
Build it with --with-nghttp2 (as Arch/Debian/Fedora do) and fail closed if
configure did not enable it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Revert "curl: build with HTTP/2 (nghttp2), so curl-sys users link it on OpenSSL 4"

This reverts commit 543010e.

* zellij: drop isahc's http2 so curl-sys links the system libcurl (OpenSSL 4)

Dropping vendored_curl was not enough: with isahc's http2 feature on,
curl-sys only links a system libcurl whose curl-config reports HTTP2, and
ours has no nghttp2 (adding it cycles curl -> nghttp2 -> cmake -> curl, so
the curl change is reverted). It then compiled its bundled curl 8.4.0, which
fails on OpenSSL 4's opaque ASN1_INTEGER. The patch removes "http2" from the
isahc declaration plus the matching Cargo.lock edit (libnghttp2-sys), so
--locked still holds; the readelf check still requires libcurl.so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* foundationdb: require libssl.so.3 of fdbserver only; forbid .so.4 everywhere

The world build failed foundationdb's own guard on arm64:
libfdb_c_shim.so "does not link libssl.so.3". The shim dlopen()s libfdb_c at
run time and links no SSL itself, so requiring .so.3 of every libfdb_c*.so
was too strict. Keep the safety property for every ELF we ship (no
libssl/libcrypto .so.4) and fdbserver as the positive control.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci: re-trigger build (or-tools' FetchContent hit GitLab overload cloning eigen)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* zellij: runtime-depend on ca-certificates (system libcurl verifies against /etc/ssl/certs; CR on gominimal#1140)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* or-tools: pinned, mirrored Eigen 3.4.0 + BZip2 instead of build-time GitLab clones

The OpenSSL 4.1 world build failed on or-tools three times today: its
FetchContent git-clones Eigen and BZip2 from gitlab.com, which answered
"unable to handle this request due to load". BZip2 was also pinned only to
GIT_TAG "master". Both are now sha256-pinned Sources mirrored to
gs://minimal-staging-archives (Eigen 3.4.0; BZip2 at master commit 66c46b8c,
2026-10-28), handed to FetchContent through FETCHCONTENT_SOURCE_DIR_EIGEN3 /
_BZIP2, with or-tools' own patches applied as its PATCH_COMMAND would
(checked with git apply --check against these trees). Fails closed if
FetchContent still downloads either. Part of pkgs#1146.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* openssl 4.1: review from msample (python test_ssl hunks, 4.x standalone test, AGENTS.md)

- python: carry the Lib/test/test_ssl.py hunks of cpython#149783 too (rebased
  to 3.14.10, exact context). The shipped test suite failed 6 of 206 test_ssl
  tests against the patched _ssl; these are upstream's matching expectation
  changes, plus test_got_eof for gh-148292. HAS_TLSv1_2 == False is upstream
  gh-159387, noted for the next bump.
- openssl: a standalone `openssl4_behaviour` test, msample's script: .so.4 and no
  engines, the legacy provider + MD4, TLS 1.2 and 1.3 loopback handshakes
  verified against a throwaway P-256 cert by IP SAN.
- openssl-3.5: link the pkgmgr-rs#1140 series pin it relies on (deployed), and
  why it is load-bearing (Repology marks every 3.5.x legacy/outdated).
- wget: the OpenSSL 4 patch applies with -F0 like python/socat's (checked:
  exact context on 1.25.0).
- AGENTS.md: an OpenSSL pattern section: port to 4.x first, openssl-3.5 for
  what can't, how to build/depend/check against it, and 4.1's dropped CN
  fallback.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* openssl: import Test for the openssl4_behaviour standalone test

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Security Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants