Re: Verify Server Certificate before connecting
Posted by: Fernando Gonzalez.Sanchez
Date: February 07, 2013 02:41PM

Connector/NEt currenly only accepts PFX files (we are planning to extend to more formats like PEM in the future).

From http://dev.mysql.com/doc/refman/5.0/en/connector-net-tutorials-ssl.html:

With PFX files, you can use a connection string like this:
using (MySqlConnection connection = new MySqlConnection(
"database=test;user=sslclient;" +
"CertificateFile=H:\\bzr\\mysql-trunk\\mysql-test\\std_data\\client.pfx" +
"CertificatePassword=pass;" +
"SSL Mode=Required "))
{
connection.Open();
}

(The tutorial also explain how to use openssl command line to embed a certificate and key from PEM into a PFX file.

Connection strings options:
http://dev.mysql.com/doc/refman/5.0/en/connector-net-connection-options.html

PS. Just to clarify, Connector/NET uses CryptoAPI but only thru the standard assembly System.Security.Cryptography (which is in the GAC in any standard .NET distro), so you shouldn't have problems running in medium trust enviroments, otherwise let me know.

Options: ReplyQuote


Subject
Written By
Posted
Re: Verify Server Certificate before connecting
February 07, 2013 02:41PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.