I would like to use the SSL_ca_path
ssl option since it is more reliable. The problem it doesn't use the certificates in the given directory.
This code works:
local $NET::HTTPS::SSL_SOCKET_CLASS = 'IO::Socket::SSL';
my $ua = LWP::UserAgent->new(ssl_opts => {
SSL_ca_file => "/etc/pki/tls/certs/ca-bundle.crt",
# SSL_ca_path => "/etc/pki/tls/certs/",
});
But using SSL_ca_path
instead of SSL_ca_file
breaks the script.
Not working
local $NET::HTTPS::SSL_SOCKET_CLASS = 'IO::Socket::SSL';
my $ua = LWP::UserAgent->new(ssl_opts => {
# SSL_ca_file => "/etc/pki/tls/certs/ca-bundle.crt",
SSL_ca_path => "/etc/pki/tls/certs/",
});
Neither renaming the certificates to *.pem
nor removing the trailing /
in the path fixes the problem.
Permissions and owner of the directory and files are the same (770)
Complete script: https://github.com/Benedikt1992/nagios-jenkins-plugin/blob/master/check_jenkins_job_extended.pl#L71-L75