curl -k -L -c cookie.txt -b cookie.txt --user administrator:done! --header "Content-Type:application/json" --header "Accept:application/json" https://10.244.204.25/api/types/names #### * SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway. #### use warnings; use LWP::UserAgent; require HTTP::Cookies; my $ua = new LWP::UserAgent; $ua->agent('Mozilla/5.0'); $cookie_jar = HTTP::Cookies->new( file => 'cookies_lwp.txt', autosave => 1, ignore_discard => 1 ); # A cookie file is needed to store the security keys. $ua->cookie_jar($cookie_jar); $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0; $ua->default_header( "Accept" =>"application/json" ); $ua->default_header( "Content-Type" => "application/json"); my $netloc="10.244.204.25:443"; $ua->credentials( $netloc, 'Security Realm', 'administrator', 'done!'); $ua->ssl_opts( verify_hostnames => 0 ,SSL_verify_mode => 0x00); my $req = new HTTP::Request('GET','https://10.244.204.25/api/types/names'); my $res = $ua->request($req); print $res->code, "\n"; print $res->message; use Data::Dumper; #### '_msg' => 'Can\'t connect to 10.244.204.25:443 (certificate verify failed)',