[monitoring-plugins] set hostname in for CURLOPT_CURL to virtual ...

Andreas Baumann git at monitoring-plugins.org
Mon Nov 12 16:30:20 CET 2018


 Module: monitoring-plugins
 Branch: feature_check_curl
 Commit: faea5899ba3264581bf75649e4b399d0b69bd125
 Author: Andreas Baumann <mail at andreasbaumann.cc>
   Date: Mon Nov 12 10:25:08 2018 -0500
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=faea589

set hostname in for CURLOPT_CURL to virtual hostname in case of SSL (for SNI to work)

---

 plugins/check_curl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index 58f454b..637e9ba 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -368,7 +368,7 @@ check_http (void)
   /* compose URL: use the address we want to connect to, set Host: header later */
   snprintf (url, DEFAULT_BUFFER_SIZE, "%s://%s:%d%s",
       use_ssl ? "https" : "http",
-      server_address,
+      use_ssl ? host_name : server_address,
       server_port,
       server_url
   );



More information about the Commits mailing list