How to turn off ssl certificate validation in jmx4perl

259 views Asked by At

I would like to setup monitoring of our Springboot application. We already have jolokia included in. I'm not able to connect to jolokia endpoint though due to ssl certificate validation failure.

GET https://localhost:9090/jolokia/search/*%3Aj2eeType%3DJ2EEServer%2C*

===========================================================
500 Can't connect to localhost:9090 (certificate verify failed)
Content-Type: text/plain
Client-Date: Mon, 07 Dec 2020 13:12:16 GMT
Client-Warning: Internal response

Can't connect to localhost:9090 (certificate verify failed)

SSL connect attempt failed error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed at /usr/lib/perl5/vendor_perl/5.26.1/LWP/Protocol/http.pm line 50.

Thank you, Radovan

1

There are 1 answers

4
pzkpfw On

You might want to try setting this environment variable:

PERL_LWP_SSL_VERIFY_HOSTNAME=0

You don't give an example of what your check command looks like, but as a general example you should be able to squeeze in environment variables at the start of it:

define command {
   command_name foo
   command_line PERL_LWP_SSL_VERIFY_HOSTNAME=0 /plugins/my_plugin.pl (...)
}

This is one way of setting the variable at run time, you can of course set it in other ways, such as in a systemd service file, but I think this is the easiest and surest way to get it to apply.