Fixed: "The requested security protocol is not supported" with MySql.Data
Asking for TLS 1.3 on a Mac gave me The requested security protocol is not supported, though MySQL and .NET 10 both support it. By default, .NET on macOS uses a TLS library that doesn't, and there's a switch to use the one that does.
What I Was Doing
I set TlsVersion=TLSv1.3 in a connection string, on MySql.Data 26.10.0 and .NET 10, on macOS:
…;SslMode=Required;TlsVersion=TLSv1.3
dotnet run test-connection.cs
What I Expected
A connection using TLS 1.3. The server allows it: its tls_version is TLSv1.2,TLSv1.3.
What I Got
Unhandled exception. System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception.
---> System.PlatformNotSupportedException: The requested security protocol is not supported.

What I Checked
A Linux container, with the same connection string, connected with TLS 1.3. So the problem is on the Mac, not in the driver or the server.
Microsoft's documentation. The .NET 10 notes explain it: "Historically, macOS used Secure Transport which doesn't support TLS 1.3; opting into Network.framework enables TLS 1.3." It's opt-in: "Existing apps continue to use the current stack unless enabled."
Why It Happens
.NET on macOS uses Apple's Secure Transport by default, which stops at TLS 1.2. Naming only 1.3 leaves it nothing it can offer.
The Fix
Pick one, depending on what you need.
To use TLS 1.3 on macOS, turn on Network.framework, for the process:
export DOTNET_SYSTEM_NET_SECURITY_USENETWORKFRAMEWORK=1
dotnet run test-connection.cs
If you don't need TLS 1.3 on your Mac, which is the usual case for development, list both versions. Each platform then uses the best it can:
…;SslMode=Required;TlsVersion=TLSv1.2,TLSv1.3
That gave TLS 1.2 on macOS, and TLS 1.3 in a Linux container.
After the Fix
With the switch, on macOS:
Connected as inventory_app@% to MySQL 9.7.4
TLS: TLSv1.3
Without the switch, with both versions listed:
Connected as inventory_app@% to MySQL 9.7.4
TLS: TLSv1.2

Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
Setting the switch and no TlsVersion | The driver still asks for 1.2 | Set both |
Naming only TLSv1.3 in a shared connection string | It fails for anyone on a Mac | List both versions |
| Spending time on the server | The server's fine | Look at the client's platform |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Cannot determine the frame size… | The server is TLS 1.3 only, and the driver offered 1.2 | The fix |
| The switch seems to do nothing | The variable isn't set in the process that runs the app | Set it in the same terminal |
Conclusion
The requested security protocol is not supported on a Mac means .NET's default TLS library can't do what you asked. Turn on Network.framework for TLS 1.3, or list both versions so that each platform uses what it can.
Additional Resources
- What's new in .NET 10 libraries: TLS 1.3 for macOS — the switch and its limits.
- Connector/NET Connection Options —
tlsversion.
