我正在尝试使用 ssl 从 ac# 应用程序连接到 mysql。以下是我的连接字符串:
server = "xxx.xxx.xxx.xxx";
database = "sqlserver";
uid = "sqlserver";
password = "password";
cert_file = "client-cert.pfx";
string connectionString;
connectionString = "SERVER=" + server + ";" + "DATABASE=" + database + ";" + "UID=" + uid + "; CertificateFile=" + cert_file + "; CertificatePassword=admin; SslMode=Required";
这是错误:
System.IO.IOException:从传输流接收到意外的 EOF 或 0 字节。在 System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) 在 System.Net.Security.SslState .StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) 在 System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest) 在 System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult) 在 MySql。 Data.MySqlClient.NativeDriver.StartSSL() 在 MySql.Data.MySqlClient.NativeDriver.Open() 在 MySql.Data.MySqlClient.Driver.Open() 在 MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder 设置) 在 MySql。数据。
我以为问题出在我的文件上,但现在我知道不是……所以我迷路了