-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Description
On Linux with OpenSSL, when using TLS 1.3 with client certificate authentication (mutual auth), resumed sessions incorrectly report IsMutuallyAuthenticated=false and LocalCertificate=null on the client side, even though the server correctly recognizes mutual authentication.
Reproduction Steps
Unit test presenting the issue.
Failing in .NET 10 but works in .NET 8 target.
https://github.com/multiarc/NET10.mTLS.Repro
Expected behavior
All connections (initial and resumed) should report IsMutuallyAuthenticated=true and LocalCertificate should return the client certificate when mutual authentication was established.
Actual behavior
- First connection:
IsMutuallyAuthenticated=true,LocalCertificateis set correctly - Resumed connections:
IsMutuallyAuthenticated=false,LocalCertificate=null
Regression?
This is a regression from .NET 8 introduced in commit 4a8a95f8841 Support TLS Resume with client certificates on Linux (#102656)
Known Workarounds
Set AllowTlsResume=false in SslClientAuthenticationOptions to disable session resumption (at the cost of performance).
Configuration
- OS: Ubuntu 24.04.3 LTS, 6.14.0-28-generic
- OpenSSL 3.0.13 30 Jan 2024 (Library: OpenSSL 3.0.13 30 Jan 2024)
- .NET versions:
- 8.0.122-0ubuntu1~24.04.1 amd64
- 10.0.100-0ubuntu1~24.04.1 amd64
- Architecture: x64
Other information
Root Cause (based on fix PR)
In NewSessionCallback (Interop.OpenSsl.cs), when TLS 1.3 issues new session tickets on resumed connections, SSL_get_certificate() returns null because no certificate was set on the SSL object for the resumed connection (certificate exchange is skipped during resumption). This null value overwrites the correct certificate tracking data in the session cache.