lundi 13 février 2017

Can't connect to MySQL server from Visual Studio(C#)

Vote count: 0

So, I want to connect to mySQL server (ubuntu, virtualbox) with ssl certificate. I've already created user for ssl connection and copied it from my virtualbox, tested connection through xampp mysql -ukek -p -h --ssl-cert "C:\xampp\mysql\bin\client-cert.cer" --ssl-key "C:\xampp\mysql\bin\client-cert.cer". Everything works perfect. Now I want to make a simple which connects to mysql server. I also created .pfx file openssl pkcs12 -export -in client-cert.pem -inkey client-key.pem -certfile ca-cert.pem -out client.pfx and copied it to my desktop. Then I've installed mysql connector, added to to using. But when I try to connect with this connection string:

using (MySqlConnection connection = new MySqlConnection(
                "datasource=;user=kek; password=1;" +
                "CertificateFile=C:\\Users\\Sergey\\Desktop\\client.pfx" +
                "CertificatePassword=1;" +
                "SSL Mode=Required"))

I get an exception : "System.Security.Cryptography.CryptographicException" in MySql.Data.dll. File not found. I don't even know what could go wrong.

asked 29 secs ago

Let's block ads! (Why?)

Can't connect to MySQL server from Visual Studio(C#)

Aucun commentaire:

Enregistrer un commentaire