Description
Without hostname verification, libcurl can accept a valid TLS certificate issued for a different host.
Potential impact
Connecting to the wrong server can expose traffic or session tokens.
Remediation
Remove test overrides and keep both hostname verification and certificate-chain verification enabled.
Examples
Before
c
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
After
c
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2L);
Setting CURLOPT_SSL_VERIFYHOST to 2L checks that the certificate is valid for the host in the URL.