]> granicus.if.org Git - curl/commitdiff
tool_operate: Show HTTPS-Proxy options on CURLE_SSL_CACERT
authorJay Satiro <raysatiro@yahoo.com>
Sat, 11 Feb 2017 21:35:47 +0000 (16:35 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Sat, 11 Feb 2017 21:35:47 +0000 (16:35 -0500)
When CURLE_SSL_CACERT occurs the tool shows a lengthy error message to
the user explaining possible solutions such as --cacert and --insecure.

This change appends to that message similar options --proxy-cacert and
--proxy-insecure when there's a specified HTTPS proxy.

Closes https://github.com/curl/curl/issues/1258

src/tool_operate.c

index db53d0d5a933a5250f3c287923303955d97c7043..ef4f74a2b40bba926b83ed198a3be74be95da337 100644 (file)
@@ -1678,8 +1678,13 @@ static CURLcode operate_do(struct GlobalConfig *global,
           fprintf(global->errors, "curl: (%d) %s\n", result, (errorbuffer[0]) ?
                   errorbuffer : curl_easy_strerror(result));
           if(result == CURLE_SSL_CACERT)
-            fprintf(global->errors, "%s%s",
-                    CURL_CA_CERT_ERRORMSG1, CURL_CA_CERT_ERRORMSG2);
+            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 "
+                     "and --proxy-insecure.\n" :
+                     ""));
         }
 
         /* Fall through comment to 'quit_urls' label */