]> granicus.if.org Git - curl/commitdiff
tool_operate: Fix showing HTTPS-Proxy options on CURLE_SSL_CACERT
authorJay Satiro <raysatiro@yahoo.com>
Thu, 16 Mar 2017 22:23:31 +0000 (18:23 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Thu, 16 Mar 2017 22:23:31 +0000 (18:23 -0400)
- Show the HTTPS-proxy options on CURLE_SSL_CACERT if libcurl was built
  with HTTPS-proxy support.

Prior to this change those options were shown only if an HTTPS-proxy was
specified by --proxy, but that did not take into account environment
variables such as http_proxy, https_proxy, etc. Follow-up to e1187c4.

Bug: https://github.com/curl/curl/issues/1331
Reported-by: Nehal J Wani
src/tool_operate.c

index 8f767152a2f6d16c2af1af7c22b28415be32d5ed..572c8d0cc98354c50e6a130f982c897b7fd4cd40 100644 (file)
@@ -1697,9 +1697,8 @@ static CURLcode operate_do(struct GlobalConfig *global,
           if(result == CURLE_SSL_CACERT)
             fprintf(global->errors, "%s%s%s",
                     CURL_CA_CERT_ERRORMSG1, CURL_CA_CERT_ERRORMSG2,
-                    ((config->proxy &&
-                      curl_strnequal(config->proxy, "https://", 8)) ?
-                     "HTTPS proxy has similar options --proxy-cacert "
+                    ((curlinfo->features & CURL_VERSION_HTTPS_PROXY) ?
+                     "HTTPS-proxy has similar options --proxy-cacert "
                      "and --proxy-insecure.\n" :
                      ""));
         }