Module: check_mk
Branch: master
Commit: a0e2e5a2dd6fcca39bf5d87b9130aa68184881fb
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a0e2e5a2dd6fcc…
Author: Andreas <ab(a)mathias-kettner.de>
Date: Wed Jun 27 13:33:55 2018 +0200
6238 FIX check_http: fixed proxy authentification problem when using NTLM
Change-Id: Ibb7a2fefd3b1f866b8f7bae82cf8db7f00931a5a
---
.werks/6238 | 10 +++++++++
.../patches/0005-check_http_proxy_usage.diff | 24 ++++++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/.werks/6238 b/.werks/6238
new file mode 100644
index 0000000..e2f245e
--- /dev/null
+++ b/.werks/6238
@@ -0,0 +1,10 @@
+Title: check_http: fixed proxy authentification problem when using NTLM
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1530099194
+Class: fix
+
+
diff --git a/omd/packages/monitoring-plugins/patches/0005-check_http_proxy_usage.diff
b/omd/packages/monitoring-plugins/patches/0005-check_http_proxy_usage.diff
new file mode 100644
index 0000000..c1e767c
--- /dev/null
+++ b/omd/packages/monitoring-plugins/patches/0005-check_http_proxy_usage.diff
@@ -0,0 +1,24 @@
+--- monitoring-plugins-2.2.orig/plugins/check_http.c 2018-06-27 13:02:11.455755974 +0200
++++ monitoring-plugins-2.2/plugins/check_http.c 2018-06-27 13:05:02.778640041 +0200
+@@ -919,6 +919,21 @@
+
+ if (verbose) printf ("Entering CONNECT tunnel mode with proxy %s:%d to dst
%s:%d\n", server_address, server_port, host_name, HTTPS_PORT);
+ asprintf (&buf, "%s %s:%d HTTP/1.1\r\n%s\r\n", http_method, host_name,
HTTPS_PORT, user_agent);
++ if (strlen(proxy_auth)) {
++ base64_encode_alloc (proxy_auth, strlen (proxy_auth), &auth);
++ xasprintf (&buf, "%sProxy-Authorization: Basic %s\r\n", buf, auth);
++ }
++ /* optionally send any other header tag */
++ if (http_opt_headers_count) {
++ for (i = 0; i < http_opt_headers_count ; i++) {
++ if (force_host_header != http_opt_headers[i]) {
++ xasprintf (&buf, "%s%s\r\n", buf, http_opt_headers[i]);
++ }
++ }
++ /* This cannot be free'd here because a redirection will then try to access
this and segfault */
++ /* Covered in a testcase in tests/check_http.t */
++ /* free(http_opt_headers); */
++ }
+ asprintf (&buf, "%sProxy-Connection: keep-alive\r\n", buf);
+ asprintf (&buf, "%sHost: %s\r\n", buf, host_name);
+ /* we finished our request, send empty line with CRLF */