sto ottenendo il seguente errore nel tentativo di connettersi a un sito Internet specifico https utilizzando LWP:Installazione di un nuovo certificato CA per Perl 5.14.2 LWP su Ubuntu 12.04
LWP::Protocol::https::Socket: SSL connect attempt failed with unknown errorerror:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed at /usr/local/share/perl/5.14.2/LWP/Protocol/http.pm line 51.
ho provato con wget e ottenuto:
Ho cercato su google e ho scoperto che probabilmente dovevo installare il ca cert radice di Dio. Ho capito come farlo (scarica certificati, metti/usr/share/ca-certificates ed esegui update-ca-certificates). Ho anche imparato come usare openssl s_client nel processo.
Ora che è installato il certificato, opere wget, ma LWP fallisce ancora con lo stesso errore e così fa OpenSSL s_client:
# openssl s_client -connect [domain]:443
CONNECTED(00000003)
depth=0 O = [domain], OU = Domain Control Validated, CN = [domain]
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 O = [domain], OU = Domain Control Validated, CN = [domain]
verify error:num=27:certificate not trusted
verify return:1
depth=0 O = [domain], OU = Domain Control Validated, CN = [domain]
verify error:num=21:unable to verify the first certificate
verify return:1
Non ho idea di dove andare per ottenere questo lavoro. Eventuali suggerimenti?
EDIT:risolto Ecco un semplice script che descrive ciò che ha funzionato dopo il suggerimento di mikew:
#!/usr/bin/perl
use LWP::UserAgent;
$URL="[domain]";
my $ua = LWP::UserAgent->new(ssl_opts => { SSL_ca_path=>'/etc/ssl/certs'});
my $response = $ua->get($URL);
questo ha funzionato quando ho aggiunto solo lo SSL_ca_path. Grazie! –
Buono a sapersi! Risposta modificata per chiarire che è necessario uno solo di SSL_ca_file o SSL_ca_path. – mikew