[monitoring-plugins] check_curl: code cleanup

Sven Nierlein git at monitoring-plugins.org
Mon Oct 29 15:20:17 CET 2018


 Module: monitoring-plugins
 Branch: feature_check_curl
 Commit: 36fd675fbe02f2492c4adbb001da38856f96c2f2
 Author: Sven Nierlein <sven at nierlein.de>
   Date: Mon Oct 29 15:09:57 2018 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=36fd675

check_curl: code cleanup

CURLOPT_RESOLVE is not required, since we do not verify certificates in any way.

---

 plugins/check_curl.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index 7a516a9..58f454b 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -377,17 +377,6 @@ check_http (void)
     printf ("* curl CURLOPT_URL: %s\n", url);
   handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_URL, url), "CURLOPT_URL");
 
-  /* cURL does certificate checking against the host name from the URL above
-   * So we use CURLOPT_CONNECT_TO or CURLOPT_RESOLVE to handle differing
-   * host names and/or ports */
-#if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 21, 3)
-  if (host_name && strcmp (host_name, server_address)) {
-    snprintf (server_ip, DEFAULT_BUFFER_SIZE, "%s:%d:%s", host_name, server_port, server_address);
-    server_ips = curl_slist_append (server_ips, server_ip);
-    handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_RESOLVE, server_ips), "CURLOPT_RESOLVE");
-  }
-#endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 21, 3) */
-
   /* extract proxy information for legacy proxy https requests */
   if (!strcmp(http_method, "CONNECT") || strstr(server_url, "http") == server_url) {
     handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_PROXY, server_address), "CURLOPT_PROXY");



More information about the Commits mailing list