check_phpfpm_status
check_phpfpm_status copied to clipboard
Use servername in SNI request when using SSL
When using the plugin locally on a specific virtual host with SSL (when using -S
explicitly or when the page is behind a redirect to HTTPS) we encounter a HTTP 400 in Apache.
How to reproduce:
./check_phpfpm_status.pl -H localhost -s example.org -u /phpfpm_status -S
Results in HTTP 400 Bad Request because of the following Apache httpd error:
[ssl:error] [pid 12345] AH02032: Hostname localhost provided via SNI and hostname example.org provided via HTTP are different
It appears the -s
servername is not used correctly for the SSL request?
We are using CentOS 7's stock Apache (httpd-2.4.6-80.el7.centos.1.x86_64
) with TLS 1.2.
Thanks for reporting this. I do not have a lot of time currently, so this issue may be quite slow to be fixed. Do not hesitate to dig around in the code and make a fork/pull request.
My Perl is pretty rusty, but it should work when using the SSL_hostname
option in IO::Socket::SSL
. It appears you are already doing that, see https://github.com/regilero/check_phpfpm_status/blob/45c0303c4fb7a9e1347d877963e0ec391a8ed089/check_phpfpm_status.pl#L391
Don't know why we are seeing errors then, I'll dig further and let you know.