centreon / centreon-plugins

Collection of standard plugins to discover and gather cloud-to-edge metrics and status across your whole IT infrastructure.
https://www.centreon.com
Apache License 2.0
311 stars 274 forks source link

Certificate check fail #2832

Closed MarOwNFR closed 3 years ago

MarOwNFR commented 3 years ago

Hi all, im trying to check certificate validity but cannot get it working

/usr/lib/centreon/plugins/centreon_protocol_x509.pl --plugin=apps::protocols::x509::plugin --mode=certificate --custommode='tcp' --hostname='***.****.com' --port=443 --warning-status='%{expiration} < 30' --critical-status='%{expiration} < 15' --ssl-opt="SSL_verify_mode => SSL_VERIFY_NONE"

Result : UNKNOWN: SSL error: SSL wants a read first

I use the "X509 Certificate" plugin (v.3.1.0) on a freshly installed centreon (v.21.04.0) with an IT edition license.

For your information I think it's the same problem as the issue #1972

I tried with and without the <--ssl-opt="SSL_verify_mode => SSL_VERIFY_NONE" > option.

In the mentioned issue I did not manage to understand the solution. Can you help me?

Thank you for your help in advance!

garnier-quentin commented 3 years ago

Try option --ssl-ignore-errors

MarOwNFR commented 3 years ago

It works perfectly! You are my lifesaver ;) Thank you very much!

garnier-quentin commented 3 years ago

You re welcome. A little like david hasselhoff ;)

frederico2023 commented 1 year ago

Hi,

im trying to check certificate validity but cannot get it working :

/usr/lib/centreon/plugins/centreon_protocol_x509.pl --plugin=apps::protocols::x509::plugin --mode=certificate --hostname=xxxxx --port=5432 --custommode=tcp --starttls=postgres --warning-status='%{expiration} < 30' --critical-status='%{expiration} < 15' --ssl-opt="SSL_verify_mode => SSL_VERIFY_NONE" --ssl-ignore-errors

Result :

UNKNOWN: Can't locate object method "peer_certificate" via package "IO::Socket::INET" at /usr/lib/centreon/plugins/centreon_protocol_x509.pl line 851.