Reputation: 63
i have installed the cacert root ca in debian and want to connect to an https page using an cacert certificate with perl, but it keeps saying "certificate verify failed". connecting via e.g. links works perfectly, so it seems perl is using its own ca bundle.
any ideas how to add the cacert to perl?
sample code:
#!/usr/bin/perl
use strict;
use warnings;
use HTTP::Request;
use LWP::UserAgent;
use Net::SSLeay;
my $request = HTTP::Request->new(GET => "https://www.cacert.org/");
my $ua = LWP::UserAgent->new();
my $response = $ua->request($request);
print $response->status_line . "\n";
output:
500 Can't connect to www.cacert.org:443 (certificate verify failed)
Upvotes: 2
Views: 1662
Reputation: 39158
Install CACertOrg::CA or set the SSL_ca_path
to the Debian certificate directory.
Upvotes: 1