curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: '--socks5-hostname' and 'CURL_DISABLE_PROXY'

From: Gisle Vanem via curl-users <curl-users_at_lists.haxx.se>
Date: Tue, 8 Mar 2022 14:59:05 +0100

Timothe Litt wrote:

>> So what in 'curl -V' is there to tell it's safe to use with
>> Tor in this way? Some additional 'Features: SOCKS5' would make
>> it a bit clearer IMHO.
>>
> Seems to me that specifying --socks5-hostname should produce a hard error if CURL_DISABLE_PROXY is set.  As should
> anything else that implies using a proxy - including API calls that specify proxy-related items.

I totally agree. I did this patch to warn & exit:

--- a/src/tool_operate.c 2022-03-04 06:19:28
+++ b/src/tool_operate.c 2022-03-08 14:25:22
_at__at_ -1296,6 +1296,16 _at__at_

            my_setopt(curl, CURLOPT_SUPPRESS_CONNECT_HEADERS,
                      config->suppress_connect_headers?1L:0L);
+
+#if defined(CURL_DISABLE_PROXY)
+ if (config->proxy_tls_username || config->proxy_tls_password ||
+ config->proxy_tls_authtype || config->proxyuserpwd || config->proxy ||
+ config->proxyver)
+ {
+ fputs ("WARNING: a 'proxy' option was used when 'CURL_DISABLE_PROXY' is set.\n",
+ global->errors);
+ exit(1);
+ }
+#endif
          }

          my_setopt(curl, CURLOPT_FAILONERROR, config->failonerror?1L:0L);

------

Not sure how it really should be done.

-- 
--gv
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2022-03-08