Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ConnectionString requires SslMode field to open the connection from Mysqlconnector 2.3.4 version #1560

Unanswered
vishnukumartr asked this question in Q&A
Discussion options

Hi Team,

Please help!!

I have windows forms application uses wixsharp to create an installer file.
.Net Framework - 4.8
MySQL server - 8.0.41
Mysqlconnector - 2.4.0
Dapper - 2.1.66

I'm facing an issue, the connectionstring using for opening sqlconnection, it requires SslMode=None to open the connection.

Using the below connection string which worked fine with 2.3.3:
string mySqlTestConnString = "server=localhost;user id=root;password=1234;port=3306;database=sakila";

Fix/Workaround -2.4.0
Adding SslMode=None to the connection string resolves the issue with 2.4.0 - working fine:
string mySqlTestConnString = "server=localhost;user id=root;password=1234;port=3306;database=sakila;SslMode=None";

If we give not the SslMode value in conn string, it throws below exception

My doubt is.

Why suddenly the connection string requires to provide SslMode value ?

If we use this SslMode=None any security issue will comeup in the future

Could anyone provide any suggestions / help. I'm stuck in this issue for past 2 days..not able to figure out.

Inner Exception:
Exception System.ArgumentException: The specified value is not valid in the 'SslProtocolType' enumeration.
Parameter name: sslProtocolType
at System.Net.Security.SslState.ValidateCreateContext(Boolean isServer, String targetHost, SslProtocols enabledSslProtocols, X509Certificate serverCertificate, X509CertificateCollection clientCertificates, Boolean remoteCertRequired, Boolean checkCertRevocationStatus, Boolean checkCertName)
at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)
at MySqlConnector.Core.ServerSession.d__126.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at MySqlConnector.Core.ServerSession.d__106.MoveNext()
Environment

Stack trace

StackTrace at MySqlConnector.Core.ServerSession.d__106.MoveNext()

--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MySqlConnector.Core.ServerSession.d__108.MoveNext()

--- End of stack trace from previous location where exception was thrown ---
at MySqlConnector.Core.ServerSession.d__108.MoveNext()

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask`1.get_Result()
at MySqlConnector.Core.ConnectionPool.d__14.MoveNext()

--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at MySqlConnector.Core.ConnectionPool.d__14.MoveNext()

--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask`1.get_Result()
at MySqlConnector.MySqlConnection.d__140.MoveNext()

--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask`1.get_Result()
at MySqlConnector.MySqlConnection.d__29.MoveNext()

--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MySqlConnector.MySqlConnection.Open()
at Installer.ConfigInputDialog.IsMySqlConnected(String connectionString)

===============

You must be logged in to vote

Replies: 1 comment

Comment options

Possibly caused by #1409.

It may be a problem with TLS 1.3 support on your system. Try adding TlsVersion = Tls12; to your connection string to allow the use of TLS, but force the use of TLS 1.2. https://mysqlconnector.net/connection-options/#TlsVersion

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /