Disabled certificate validation

Disabled certificate validation

Description

When TLS chain verification is disabled, libcurl can accept a server certificate issued by an authority it does not trust.

Potential impact

Credentials, session tokens or other sensitive data may reach a server impersonating the intended service.

Remediation

Remove test overrides from production and keep both chain and hostname checks enabled. If the service uses a private CA, add its CA certificate to the trust store.

Examples

Before

c
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);

After

c
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);

The default CURLOPT_SSL_VERIFYPEER value, 1L, verifies the server’s certificate chain.

References