Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Failed to check website with self signed certificate #31

Open
mrgohin opened this issue Apr 26, 2018 · 1 comment
Open

Failed to check website with self signed certificate #31

mrgohin opened this issue Apr 26, 2018 · 1 comment

Comments

@mrgohin
Copy link

mrgohin commented Apr 26, 2018

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",
    },
@mrgohin mrgohin changed the title Failed to check website with selfsigned certificate Failed to check website with self signed certificate May 7, 2018
@sensemila
Copy link

I think we need add ca certificate and not the host certificate

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants