[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Connection testing via Basic Authorization not working (was: Not using m
From: |
Marcus Mülbüsch |
Subject: |
Connection testing via Basic Authorization not working (was: Not using method "HEAD" for connection testing) |
Date: |
Tue, 2 Aug 2016 17:56:41 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
Hello list,
I want to check a remote host which uses Authorization for access.
However, monit always gets an 401 response.
I changed my configuration to port 80 so I can tcpdump the traffic.
I changed username and password to wiki:pedia, because the German
Wikipedia uses this pair to demonstrate base64 encoding.
My config thus is:
check host PBX-Alarms with address 11.22.33.44
if failed
port 80
protocol http
request "/LOG0/FAULT/mod_cmd.xml?cmd=xml-alarms"
use http headers [Authorization: "Basic d2lraTpwZWRpYQ=="] #
"wiki:pedia"
then alert
When using links as browser from the same machine I see the request
GET /LOG0/FAULT/mod_cmd.xml?cmd=xml-alarms HTTP/1.1
...
User-Agent: Links (2.8; Linux 3.10.40-vs2.3.6.8 x86_64; GNU C 4.6.4; text)
...
Authorization: Basic d2lraTpwZWRpYQ==
and the server responds with:
HTTP/1.1 200 OK
Using monit, the request is:
GET /LOG0/FAULT/mod_cmd.xml?cmd=xml-alarms HTTP/1.1
...
User-Agent: Monit/5.17.1
Authorization:Basic d2lraTpwZWRpYQ==
and the response is:
HTTP/1.1 401 Unauthorized
I'm not quite sure whether the missing space between
"Authorization:" and "Basic" is mandated by RFC 2616, but that seems to
be the only functional difference.
Is this a monit bug? Or a server bug? Or is my configuration wrong?
Thank you,
Marcus
- Connection testing via Basic Authorization not working (was: Not using method "HEAD" for connection testing),
Marcus Mülbüsch <=