.NET: Microsoft Technologies based on the .NET software framework. Runtime: An environment required to run apps that aren't compiled to machine language.
I hit something very similar a while ago. On Windows .NET uses Schannel for TLS, while on Linux it is OpenSSL, so a test that passes on Linux can still fail on Windows. Before opening a ticket I'd check these four things, they cover most cases:
- Look at the InnerException of the AuthenticationException. If it is a Win32Exception with 0x8009030E ("No credentials are available in the security package"), the server certificate has an ephemeral private key, which is typical when it is loaded with X509Certificate2.CreateFromPem. Schannel can't use those keys. Re-import it as PFX, for example:
X509CertificateLoader.LoadPkcs12(cert.Export(X509ContentType.Pfx), null). - Make sure the issuing CA is in the Windows certificate store. Linux tests often trust it through a file or an environment variable that Windows doesn't see.
- Check that the host name you connect to matches the certificate SAN.
localhostvs127.0.0.1catches a lot of people. - For diagnostics without turning validation off: enable Schannel event logging, or collect the System.Net.Security events with dotnet-trace.
The official troubleshooting page covers the ephemeral key case and the trust store: https://learn.microsoft.com/en-us/dotnet/core/extensions/sslstream-troubleshooting
If it still fails, paste the inner exception text here and I'll take a look.
Drafted with AI assistance and checked against the documentation.
Happy to help further: (irrelevant content removed)