CURLOPT_PR...VERIFYHOST(3)
π CURLOPT_PROXY_SSL_VERIFYHOST(3) β like, the libcurl manual page, bestie β¨
okay so real talk, this page lives in the Library Functions Manual and it's the whole glow-up on CURLOPT_PROXY_SSL_VERIFYHOST, no cap. sit down, grab a strawberry drink π, we're checking proxy cert names today.
πΈ NAME πΈ
CURLOPT_PROXY_SSL_VERIFYHOST β verify the proxy certificate's name against host. that's it, that's the vibe check π¦
β¨ SYNOPSIS β¨
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSL_VERIFYHOST,
long verify);
π DESCRIPTION π
so you pass a long and you set it to 2L, and that's you asking curl to verify the HTTPS proxy's certificate name fields against the proxy name. literally the whole point. π
this option determines whether libcurl verifies that the proxy cert contains the correct name for the name it is known as. like, is this actually the proxy you think it is or are we being catfished π
when CURLOPT_PROXY_SSL_VERIFYHOST(3) is 2, the proxy certificate must indicate that the server is the proxy to which you meant to connect to, or the connection fails. no negotiation, no "well maybe", it fails. periodt.
curl considers the proxy the intended one when the Common Name field or a Subject Alternate Name field in the certificate matches the hostname in the proxy string which you told curl to use. cute matching game, but make it cryptography π
π«Ά if the verify value is set to 1:
- In
7.28.0and earlier: treated as a debug option of some sorts, not supported anymore due to frequently leading to programmer mistakes. it's giving legacy chaos, we don't do that here π - From
7.28.1to7.65.3: setting it to1madecurl_easy_setopt(3)return an error and leaving the flag untouched. so it just... politely refused. iconic honestly. - From
7.66.0: treats1and2the same. that's it, they're twins now π
when the verify value is 0L, the connection succeeds regardless of the names used in the certificate. use that ability with caution. π¨ like genuinely, that is the "no thoughts, head empty" setting and the manpage is being very polite about it.
also see CURLOPT_PROXY_SSL_VERIFYPEER(3) to verify the digital signature of the proxy certificate. different check, different icon, both slay π₯
π DEFAULT π
2
(the responsible default. the main character default. π )
πΌ PROTOCOLS πΌ
this functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. the whole squad. π
all TLS backends support this option. every single one. we love an inclusive icon β¨
π¦ EXAMPLE π¦
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
/* Set the default value: strict name check please */
curl_easy_setopt(curl, CURLOPT_PROXY_SSL_VERIFYHOST, 2L);
curl_easy_perform(curl);
}
}
look at that comment β "strict name check please" β the politeness, the boundaries, we stan π«Ά
β AVAILABILITY β
added in curl 7.52.0. vintage-ish but still serving π
π RETURN VALUE π
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK, non-zero means an error occurred, see libcurl-errors(3). zero is the green flag, anything else means go read the errors page, bestie πΈ
π SEE ALSO π
the whole friend group, all linked, all valid π
and that's the page!! brought to you by libcurl, dated 2026-10-12, filed forever under CURLOPT_PR...VERIFYHOST(3). mwah π go verify those proxy names, ily π§π
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms