Mysql CA证书 SSL加密
公司要求使用SSL加密连接MYSQL 记录一下过程。
首先使用的库是MySqlConnector,配合的ORM是Dapper。.NET框架为 .net framework4.8
var builder = new MySqlConnectionStringBuilder { Server = "********", Port = 3306, Database = "******", UserID = "*******", Password = "*******", SslMode = MySqlSslMode.Required, SslCert = @"D:\File\Mysql\cert.pem", SslCa = @"D:\File\Mysql\ca.pem", SslKey = @"D:\File\Mysql\key.pem", };
string conStrDetail = builder.ConnectionString;
连接字符串
Server=*******;Port=3306;User ID=****;Password=****;Database=****;SSL Mode=Required;SSL Cert=D:\File\Mysql\cert.pem;SSL Key=D:\File\Mysql\key.pem;SSL CA=D:\File\Mysql\ca.pem