mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-06-09 08:42:17 -04:00
check_curl: handle proxied https requests
This commit is contained in:
parent
7eb43858db
commit
787e6986ee
1 changed files with 13 additions and 2 deletions
|
|
@ -371,8 +371,19 @@ check_http (void)
|
|||
}
|
||||
#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 21, 3) */
|
||||
|
||||
/* set port */
|
||||
handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_PORT, server_port), "CURLOPT_PORT");
|
||||
/* extract proxy information for legacy proxy https requests */
|
||||
if (!strcmp(http_method, "CONNECT")) {
|
||||
handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_PROXY, server_address), "CURLOPT_PROXY");
|
||||
handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_PROXYPORT, (long)server_port), "CURLOPT_PROXYPORT");
|
||||
if (verbose>=2)
|
||||
printf ("* curl CURLOPT_PROXY: %s:%d\n", server_address, server_port);
|
||||
http_method = "GET";
|
||||
handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_URL, server_url), "CURLOPT_URL");
|
||||
//server_port = use_ssl ? HTTPS_PORT : HTTP_PORT;
|
||||
} else {
|
||||
/* set port */
|
||||
handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_PORT, server_port), "CURLOPT_PORT");
|
||||
}
|
||||
|
||||
/* set HTTP method */
|
||||
if (http_method) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue