Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old


Whether to verify the host name in the DOH (DNS-over-HTTPS) SSL certificate.

Component Version macOS Windows Linux Server iOS SDK
CURL 11.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "CURL.SetOptionDOHSSLVerifyHost"; curl; Value )   More


Parameter Description Example
curl The CURL session handle. $curl
Value The new setting. 2


Returns OK or error.


Whether to verify the host name in the DOH (DNS-over-HTTPS) SSL certificate.
Pass a 2 as asking curl to verify the DOH (DNS-over-HTTPS) server's certificate name fields against the host name.
This option is the DOH equivalent of CURL.SetOptionSSLVerifyPeer and only affects requests to the DOH server.
When CURL.SetOptionDOHSSLVerifyHost is 2, the SSL certificate provided by the DOH server must indicate that the server name is the same as the server name to which you meant to connect to, or the connection fails.
Curl considers the DOH server the intended one when the Common Name field or a Subject Alternate Name field in the certificate matches the host name in the DOH URL to which you told Curl to connect.
When the verify value is set to 1 it is treated the same as 2. However for consistency with the other VerifyHost options we suggest use 2 and not 1.
When the verify value is set to 0, the connection succeeds regardless of the names used in the certificate. Use that ability with caution!

See also DOH_SSL_VERIFYHOST option in CURL manual.

See also

Release notes

Blog Entries

Created 31st March 2021, last changed 2nd April 2021

CURL.SetOptionDNSShuffleAddresses - CURL.SetOptionDOHSSLVerifyPeer