SqlConnectionStringBuilder.TrustServerCertificate Property


获取或设置一个值,该值指示在跳过用于验证信任的证书链遍历时是否加密信道。Gets or sets a value that indicates whether the channel will be encrypted while bypassing walking the certificate chain to validate trust.

 property bool TrustServerCertificate { bool get(); void set(bool value); };
public bool TrustServerCertificate { get; set; }
member this.TrustServerCertificate : bool with get, set
Public Property TrustServerCertificate As Boolean

Property Value


一个 BooleanA Boolean. 已识别的值为 truefalseyesnoRecognized values are true, false, yes, and no.


TrustServerCertificate 设置为 true 时,传输层将使用 SSL 来加密通道并跳过证书链以验证信任。When TrustServerCertificate is set to true, the transport layer will use SSL to encrypt the channel and bypass walking the certificate chain to validate trust. 如果将 TrustServerCertificate 设置为 true 并启用了加密,则即使 Encrypt 设置为 false,也将使用服务器上指定的加密级别。If TrustServerCertificate is set to true and encryption is turned on, the encryption level specified on the server will be used even if Encrypt is set to false. 否则连接将会失败。The connection will fail otherwise.

有关详细信息,请参阅加密层次结构使用不带验证的加密For more information, see Encryption Hierarchy and Using Encryption Without Validation.

Applies to

See also