部署系统,登录时,出现下面异常错误:
调用 SSPI 失败,请参见内部异常。
来源: System
实例: 在 System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
在 System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
在 System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, 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 settings)
在 MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
在 MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
在 MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
在 MySql.Data.MySqlClient.MySqlPool.GetConnection()
在 MySql.Data.MySqlClient.MySqlConnection.Open()
在 MySql.Data.MySqlClient.MySqlProviderServices.GetDbProviderManifestToken(DbConnection connection)
在 System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection)
1)此问题因mysql数据库没有安装ssl证书导致,在database.config里面的数据库连接字符串加下sslmode=none;
<add name="BaseDb" connectionString="server=192.168.1.1;port=3306;user id=root;password=123456;database=dt_xt;charset=utf8;Old Guids=true;
sslmode=none;
" providerName="MySql.Data.MySqlClient" />
2)因mysql8 与mysql5.7登录验证方法不一样。所以在mysql的服务器上,到
C:\ProgramData\MySQL\MySQL Server 8.0
目录下,找到
my.ini
文件,在# The default authentication plugin to be used when connecting to the server的下面加default_authentication_plugin=mysql_native_password设置,8的验证方法是caching_sha2_password,要改成5.7的mysql_native_password。保存后,记得重启mySql8服务。(
注意:C:\ProgramData是隐藏目录,直接将路径在文件夹中拷入
)
# The default authentication plugin to be used when connecting to the server
#caching_sha2_password
default_authentication_plugin=mysql_native_password
2017-11-12 12:49:53:706] OnServerConnectionAvailable error : System.
Security
.
Au
thentication.
Au
thenticationException:
调用
S
SPI
失败
,
请
参见
内部
异常
。 ---> System.ComponentModel.Win32Exception: 因为算法不同,客户端和服务器无法通...
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文件 S
SPI
C语言头文
C#
连接
MySql
时,System.
Security
.
Au
thentication.
Au
thenticationException:
调用
S
SPI
失败
,
请
参见
内部
异常
。所用版本4.5.0
原因分析:
据查此问题因
mysql
数据库没有安装
ssl
证书导致。
解决方案:
连接
字符串中加上“
Ssl
Mode=none”,。
string connectStr = "server=127.0.0.1; User Id=root; password=123456; Database=studentdb;S
System.
Security
.
Security
Exception Failed to negotiate HTTPS connection with server.fiddler
.net
work.https> HTTPS handshake to http:*********** failed. System.
Security
.
Au
thentication.
Au
thenticationException
调用
S
SPI
失败
, < 要求的函数不受支持\n"2,fiddler代理设置,也正常。