Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More user friendly error when Mozilla::CA fails to load

  • Loading branch information...
commit 2697c4deafd48c850c36994d4b0887626b6c59c3 1 parent 779f794
@gisle authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/LWP/Protocol/https.pm
View
10 lib/LWP/Protocol/https.pm
@@ -21,7 +21,15 @@ sub _extra_sock_opts
}
if ($ssl_opts{SSL_verify_mode}) {
unless (exists $ssl_opts{SSL_ca_file} || exists $ssl_opts{SSL_ca_path}) {
- require Mozilla::CA;
+ eval {
+ require Mozilla::CA;
+ };
+ if ($@) {
+ if ($@ =! /^Can't locate Mozilla\/CA\.pm/) {
+ $@ = "Can't verify SSL peers without knowning which Certificate Authorities to trust";
+ }
+ die $@;
+ }
$ssl_opts{SSL_ca_file} = Mozilla::CA::SSL_ca_file();
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.