Environment
Windows XP SP3, .NET 3.5 SP 1, 3.0 SP2, 2.0 SP2
Library version: 4.70.23.0
Description
The issue occurs when I try to open ssl connection (all my certificates were checked with mysql client and everything worked fine). Here is the stack trace of exception which I catch by UnhandledException event:
CoreLab.Security.SSL.as.a(Exception A_0)
CoreLab.Security.SSL.as.f(IAsyncResult A_0)
System.Net.ContextAwareResult.CompleteCallback(Object state)
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
System.Net.ContextAwareResult.Complete(IntPtr userToken)
System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
What does it mean?
Code: Select all
var connectionString = "server=localhost;database=test;uid=ssluser;pwd=sslpass;protocol=ssl;Connection timeout=150;"
var mySqlConnection = new MySqlConnection(connectionString);
mySqlConnection.SslOptions.CACert = @"file://" + caCertificate;
mySqlConnection.SslOptions.Cert = @"file://" + userCertificate;
mySqlConnection.SslOptions.Key = @"file://" + userPrivateKey;
try
{
mySqlConnection.Error += mySqlConnection_Error;
mySqlConnection.Open();
}
catch (MySqlException e)
{
// log exception message
}