如果您创建常规 Azure SQL 数据库并转到门户中的“连接字符串”选项卡,则所有连接字符串都具有 TrustServerCertificate=False
参数。这是为什么? Microsoft 不信任自己的证书?
更新: 我想这只是糟糕的命名。在the official documentation中找到了这个:
When
TrustServerCertificate
is set totrue
, the transport layer will use SSL to encrypt the channel and bypass walking the certificate chain to validate trust. IfTrustServerCertificate
is set totrue
and encryption is turned on, the encryption level specified on the server will be used even ifEncrypt
is set tofalse
. The connection will fail otherwise.
最佳答案
TrustServerCertificate=true
表示客户端将信任从 SQL Server 获取的证书,而无需完全验证它。这显然是一件坏事,所以始终使用TrustServerCertificate=false
。
关于sql-server - Azure SQL 数据库中没有服务器证书信任,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71038577/