SSL Connections Never Work
Posted: Mon  30 Apr 2007 13:17
				
				I have tested the SSL connectivity on two different valid MySQL SSL enabled installations.  The Exception always thrown is "Lost connection to MySQL server during query".  
I have tested both of these installations using both the MySQL client and a 3rd party MySQL tool, and successfully connected.
Example code:
Please help with this issue.
			I have tested both of these installations using both the MySQL client and a 3rd party MySQL tool, and successfully connected.
Example code:
Code: Select all
 MySqlConnection Connection = new MySqlConnection();
                Connection.Host = HostName.Text;
                Connection.UserId = Username.Text;
                Connection.Password = Password.Text;
                Connection.Port = Convert.ToInt32(Port.Text);
                if (UseSSL.Checked == true) {
                    SslOptions ssl = new SslOptions();
                    ssl.CACert = "file://"+CACertificate.Text;
                    ssl.Cert = "file://" + ClientCertificate.Text;
                    if (Cipher.Text.Trim().Length > 0) {
                        ssl.CipherList = Cipher.Text.Trim();
                    }
                    ssl.Key = "file://" + ClientKey.Text;
                    Connection.SslOptions = ssl;
                    Connection.Protocol = MySqlProtocol.Ssl;
                } // end if
Connection.Open();