Failed to check website with self signed certificate
Hi,
I use your Webinject for my Icinga 2 check plugin and run in some trouble with a selfsigned certificate. The problem was located at LWP perl module which seems to be not able handling this type of certificate because it have no Root certificate for validation.
There are two solution first is ignoring certificate validation what not solve the cause of problem but make the plugin easy usable in a selfsign enviornment. Second solution is offering LWP the root certificate for validation.
So I will suggest implementing this feature to ignore or offer webinject certificates. Like:
webinject.pl -c config.xml testcases.xml --no_ssl_verify or
webinject.pl -c config.xml testscases.xml --ssl_cert /root/pki/certs/host.pem --ssl_key /root/pki/keys/host-key.pem
Code example:
This makes LWP ignoring the cert but I wish that webinject drop this line if I indicate it to do this with a switch or something:
$useragent->ssl_opts(verify_hostname => 0);
And this makes LWP using certificates here same with a switch and passing the paths
$useragent->ssl_opts => {
SSL_use_cert => 1,
SSL_cert_file => "/path/to/clientcert.crt",
SSL_key_file => "/path/to/privatekey.key",
},
I think we need add ca certificate and not the host certificate