skip to main content
Using the ADO.NET Client : Specifying Connection Options : Host Name In Certificate
 

Host Name In Certificate

Property

HostNameInCertificate

Description

Specifies a host name for certificate validation when validation is enabled (Validate Server Certificate=True). This connection string option provides additional security against man-in-the-middle (MITM) attacks by ensuring that the server the data provider is connecting to is the server that was requested.

Valid Values

empty string | host_name
If no host name is specified, the data provider compares the value specified for the Host option to the Common Name (CN) parts of the certificate’s Subject name. If the values do not match, the connection fails and the data provider throws an exception.
Note: If multiple CN parts are present, the data provider validates the host name against each CN part. If any one validation succeeds, a connection is established.
If validation or SSL encryption is not enabled, this option is ignored.

Default

An empty string