Skip to content

investigate TLS13 on MacOS #1979

Open

Description

@wfurt

It seems like on Catalina TLS1.3 works out of the box - at least with Safari.
However, when I try to use in .NET I get the following error:

System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
 ---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception.
 ---> Interop+AppleCrypto+SslException: bad protocol version
   --- End of inner exception stack trace ---

This may be because API we currently use is marked as obsolete or there may be something missing since TLS1.3 support got out before Catalina. And all TLS1.3 tests are disabled on all versions of MacOS.

related to #1720

Activity

  1. added and removed
    untriagedNew issue has not been triaged by the area owner
    on Feb 13, 2020
  2. added this to the 5.0 milestone on Feb 13, 2020
  3. wfurt commented on May 26, 2020

    @wfurt
    MemberAuthor

    It seems like we will need to rewrite PAL to use new Network framework API.
    That should fix iOS as well.

    https://mailarchive.ietf.org/arch/msg/tls/5QjzTilqjomSyzENtgfaAqQOhbA/

  4. modified the milestones: 5.0.0, Future on Jun 18, 2020
  5. karelz commented on Jun 18, 2020

    @karelz
    Member

    Triage: Will require PAL rewrite on Mac -- out of scope of 5.0.
    The new Catalina API will help also iOS and light up TLS 1.3 there.

  6. chucker commented on Mar 24, 2022

    @chucker

    Is this still current? In a .NET 6 console app with macOS 12.3 against a host that only seems to support TLS 1.3, I still get the same stacktrace as above. .NET info:

    Details .NET SDK (reflecting any global.json): Version: 6.0.201 Commit: ef40e6aa06

    Runtime Environment:
    OS Name: Mac OS X
    OS Version: 12.3
    OS Platform: Darwin
    RID: osx.12-x64
    Base Path: /usr/local/share/dotnet/sdk/6.0.201/

    Host (useful for support):
    Version: 6.0.3
    Commit: c24d9a9

    .NET SDKs installed:
    6.0.201 [/usr/local/share/dotnet/sdk]

    .NET runtimes installed:
    Microsoft.AspNetCore.App 6.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
    Microsoft.NETCore.App 6.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

  7. wfurt commented on Mar 24, 2022

    @wfurt
    MemberAuthor

    yes, it is @chucker. #27727 has more detail but it is essentially same work. It is not clear at this moment if it is even feasible.

  8. bhoffman-splunk commented on May 5, 2022

    @bhoffman-splunk

    Not to add pressure, but I am more and more encountering TLS 1.3-only systems. This is especially true for internal, greenfield APIs that companies build, since they can "start secure" from the beginning. Any work around (such leveraging OpenSSL as is done in Linux) would be tremendously helpful.

  9. wfurt commented on May 5, 2022

    @wfurt
    MemberAuthor

    Is there need for client, server or both? I was thinking about some fallback because to allow HTTP2 for macOS developers (#27727) We generally do that for HTTP3/Quic (preview in 6.0) so we have some parts already in a place. if we go down this path, it would probably be opt-in feature with dependency on OpenSSL from Brew/MacPorts. Would that be acceptable?

  10. chucker commented on May 5, 2022

    @chucker

    @wfurt client in my case. macOS as a server is uncommon. But server might still be useful (if less important) for developers who run Kestrel on a Mac?

  11. 62 remaining items

  12. wfurt commented on Nov 14, 2025

    @wfurt
    MemberAuthor

    I don't see anything obvious. Client offered several versions and server picked 1.2 with some EC suite. Then it has some exchange and it dies. We will probably need to set up some repro. I don't think we have done any testing with SQL. There is another layer of complexity where the TLS frames are chipped and embedded inside TDS.

  13. removed their assignment
    on Nov 17, 2025
  14. fhenriquezn commented on Dec 4, 2025

    @fhenriquezn

    Hey guys, I am experiencing the same TLS protocol error on .NET 10 with macOS Tahoe (26.1) on Apple M4 Max. When running dotnet restore --verbosity detailed, it fails with:

    The SSL connection could not be established...
    Authentication failed...
    bad protocol version

    I've already tried dotnet dev-certs https --trust and clearing local certificates, but the issue persists. Is there a specific workaround or fix for this environment?

  15. wfurt commented on Dec 4, 2025

    @wfurt
    MemberAuthor

    Are you restoring from some private server or is it reachable publicly @fhenriquezn? @liveans has repro for the SQL case above and he is trying to figure it out.

  16. fhenriquezn commented on Dec 5, 2025

    @fhenriquezn

    @wfurt Yes, it's a private server. It's behind Cloudflare. I had the "Minimum TLS Version" setting configured to 1.3 in the Cloudflare dashboard (SSL/TLS → Edge Certificates).

    Changing it back to 1.2 allowed dotnet restore to succeed immediately.

    To clarify, my goal is to use TLS 1.3. I was under the impression that native support (which wasn't slated for .NET 9) would arrive with .NET 10, but that doesn't seem to be fully the case yet.

  17. wfurt commented on Dec 5, 2025

    @wfurt
    MemberAuthor

    It is not enabled by default @fhenriquezn. See #1979 (comment)
    Current goal is to flip the switch in 11.0 if we can resolve reported issues.

  18. fhenriquezn commented on Dec 5, 2025

    @fhenriquezn

    Yes, but that will only partially solve it. That configuration may work for the running application, but not for CLI commands like dotnet restore—am I correct?

  19. wfurt commented on Dec 5, 2025

    @wfurt
    MemberAuthor

    Using DOTNET_SYSTEM_NET_SECURITY_USENETWORKFRAMEWORK=1 environment should work of any tool.

  20. fhenriquezn commented on Dec 5, 2025

    @fhenriquezn

    That worked, thank you very much :)

  21. wfurt commented on Dec 5, 2025

    @wfurt
    MemberAuthor

    Just to be sure: you set the MinTLS back to 1.3 and everything is good so far, right?

  22. fhenriquezn commented on Dec 5, 2025

    @fhenriquezn

    Yes sir

    Image
    1. I am using zsh, so nano ~/.zshrc
      1.2. add export DOTNET_SYSTEM_NET_SECURITY_USENETWORKFRAMEWORK=1 then save
    2. I also added it into my Program.cs as commented before:
    if (OperatingSystem.IsMacOS())
    {
        AppContext.SetSwitch("System.Net.Security.UseNetworkFramework", true);
    }
    
  23. modified the milestones: 11.0.0, 12.0.0 on Jun 30, 2026
  24. added theissue type on Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions