If host_name is specified, the driver examines the subjectAltName values included in the certificate. If a dnsName value is present in the subjectAltName values, then the driver compares the value specified for Host Name In Certificate with the dnsName value. The connection succeeds if the values match. The connection fails if the Host Name In Certificate value does not match the dnsName value.
If #SERVERNAME# is specified, the driver compares the host server name specified as part of a data source or connection string to the dnsName or the commonName value.