Share via


SqlConnectionStringBuilder.HostNameInCertificate Property

Definition

Gets or sets the host name to use when validating the server certificate for the connection. When not specified, the server name from the Data Source is used for certificate validation. (Only available in v5.0+)

public:
 property System::String ^ HostNameInCertificate { System::String ^ get(); void set(System::String ^ value); };
public string HostNameInCertificate { get; set; }
member this.HostNameInCertificate : string with get, set
Public Property HostNameInCertificate As String

Property Value

The value of the HostNameInCertificate property, or String.Empty if none has been supplied.

Remarks

This property corresponds to the "HostNameInCertificiate" and "Host Name in Certificiate" keys within the connection string.

Note

This property only applies when using Encrypt in Mandatory or Strict mode, otherwise it is ignored.

Applies to