Permalink
Browse files

verify_hostname defaults to 0 if ssl_opts provided [RT#67947]

Let verify_hostname default from the environment when other ssl_opts
are passed.
  • Loading branch information...
1 parent a406ab1 commit d0b37b0257ac6260c339116ee49c221970268a4d @madsen madsen committed Oct 11, 2011
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/LWP/UserAgent.pm
@@ -31,10 +31,9 @@ sub new
my $timeout = delete $cnf{timeout};
$timeout = 3*60 unless defined $timeout;
my $local_address = delete $cnf{local_address};
- my $ssl_opts = delete $cnf{ssl_opts};
- unless ($ssl_opts) {
+ my $ssl_opts = delete $cnf{ssl_opts} || {};
+ unless (exists $ssl_opts->{verify_hostname}) {
# The processing of HTTPS_CA_* below is for compatiblity with Crypt::SSLeay
- $ssl_opts = {};
if (exists $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}) {
$ssl_opts->{verify_hostname} = $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME};
}

0 comments on commit d0b37b0

Please sign in to comment.