-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSL Authentication error thrown when opening many connections in parallel #1448
Comments
I tried using Do you have any server-side logs from when this fails? We might need to see a Wireshark packet capture of the TLS negotiation failure (although with 100 concurrent connections it might be difficult to identify the one exhibiting the problem). |
I turned on verbose error logging and here's what I see in
|
I'm having a similar issue when connecting an ASPNET Core (version 8) solution to a MySQL server (version 8.0.36) using the Pomelo EF provider (version 8.0.2) and MySqlConnector version 2.3.5 (loaded transitively by the Pomelo provider), but it happens intermittently and for fewer connections than described by @madelson (sometimes as few as 6 parallel requests). When the error occurs, ASPNET Core throws an exception with the following message:
I did some research and came across a similar issue described in dotnet/runtime#77393 (comment), and following their solution I was able to prevent the error from happening by disabling TLS 1.3 in the Windows system running the solution, but that is not a permanent solution. Also, please note we were not able to reproduce the error in a Mac machine. I hope this can provide some insight into the issue and I'm looking forward to a solution. Thanks in advance. |
Can you try reverting that registry change and using |
Yes it works. I did as you suggested (reverted the registry change and modified the connection string) and the error stopped happening. This is a much less intrusive solution, thanks for the help. |
MySqlConnector just calls A Wireshark packet capture (of successful and unsuccessful connections) may help isolate the problem, but we might need to pass the packet capture to the .NET team for deeper investigation; it seems unlikely to me that this is a MySqlConnector problem. |
I had the same problem running unit tests with ReSharper's test runner. I have it set to run 8 tests in parallel. The problem was interminent but if I choose "Run Test until Fail" it would fail within 5 or so runs. Adding TlsVersion = TLS 1.2 to the connection string has solved the problem. |
This appears to be an issue with the underlying OS/.NET TLS implementation, and users have found a workaround. |
Software versions
MySqlConnector version: 2.3.5
Server type (MySQL, MariaDB, Aurora, etc.) and version: MySQL Community Edition 8.2.0 on Windows
.NET version: 8
Describe the bug
When I try to open a large number of connections in parallel, I get SSL Authentication Error failures.
Exception
Code sample
Expected behavior
I would expect this code to run without error.
Additional context
I also tested this with some older versions of MySqlConnector (1.x, 2.2.x) and all seemed to exhibit the issue.
EDIT: I realized that setting Tls12 specifically also seems to fix it. There are some other issues floating around in the repo regarding that so apologies if this is a dupe.
The text was updated successfully, but these errors were encountered: