-2

check_wmi_plus is a Perl based Windows monitoring tool. For monitoring, it has to communicate through WMIC server (a web application).

When the WMIC server is hosted over HTTP its works fine..., but not on HTTPS

In the check_wmi_plus.conf, there is an option to enter wmic_url, entered the configuration as below, but its not working

$wmic_server_uri='https://192.168.59.90/wmic';

In the check_wmi_plus.conf file I could not see an option to provide the SSL certificate path..

From the code I could see that it uses the Perl LWP module,

 my $req = HTTP::Request->new( 'POST', $wmic_server_uri );
 $req->header( 'Content-Type' => 'application/json' );^M
 $req->content( $json );

 my $ua = new LWP::UserAgent;
 my $res = $ua->request($req);

Which is the default certificate location Perl LWP module refer for SSL certificate?

brian d foy
  • 129,424
  • 31
  • 207
  • 592
user2264738
  • 302
  • 4
  • 18
  • What is "not working"? Is there an error message? Can you make a minimal reproducible example? The `HTTP::Request` module does not make a request. It creates the request for something else to send, so we need to see that. – brian d foy Dec 05 '22 at 18:26
  • check_wmi_plus is a Perl based Windows monitoring tool, for monitoring, it has to communicate with WMIC server a web application hosted over HTTPS When the WMIC server is hosted over HTTP its works fine..., but not on HTTPS i need to know what's the default location.., where Perl - LWP module will refer for ssl certificates – user2264738 Dec 06 '22 at 07:50

1 Answers1

2

You can set the SSL certs directory to whatever you like by specifying some environment variables:

PERL_LWP_SSL_CA_FILE
PERL_LWP_SSL_CA_PATH
The file and/or directory where the trusted Certificate Authority certificates is located. See LWP::UserAgent for details.

In LWP::UserAgent, you can use ssl_opts to set these values.

Otherwise, IO::Socket::SSL or Net::SSLeay, which do the real work, are going to get those values from your openssl installation. That answer depends on the platform and installation options so there is no one answer. There's some good strategies in How to find out the path for OpenSSL trusted certificates?

brian d foy
  • 129,424
  • 31
  • 207
  • 592