allowing CA file to be specified seperate from SSL key and cert to allow for host name verification only, thanks to "IMBS David" <david.imbs@open-groupe.com>

This commit is contained in:
Kevin L. Kane 2015-08-04 08:45:22 -04:00
parent 80abdf03e3
commit f3e60356ec

View File

@ -366,10 +366,12 @@ sub request {
$ua->ssl_opts(SSL_cert_file => $self->getCert);
$ua->ssl_opts(SSL_key_file => $self->getKey);
if(my $ca = $self->getCa){
croak "REST::Client exception: Cannot read CA file" unless -f $ca;
$ua->ssl_opts(SSL_ca_file => $ca);
}
}
#prime LWP with CA file if we have one
if(my $ca = $self->getCa){
croak "REST::Client exception: Cannot read CA file" unless -f $ca;
$ua->ssl_opts(SSL_ca_file => $ca);
}
#prime LWP with PKCS12 certificate if we have one