Created
July 29, 2014 22:38
-
-
Save jyotty/e46a621d43b1ae538df0 to your computer and use it in GitHub Desktop.
If for some sad reason you're stuck using perl+LWP 5.8 on RHEL 6, here's how to make HTTPS actually secure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# as far as I can tell the SSL_CERT_* environment variables are not | |
# respected, and the SSL_ca_path argument doesn't work at all. Yay. | |
sub lwp_58_extra_sock_opts { | |
# turn on peer verification without subclassing LWP::Protocol::https | |
use IO::Socket::SSL; | |
return ( | |
SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_PEER, | |
SSL_ca_file => '/etc/pki/tls/certs/ca-bundle.crt', | |
SSL_version => 'TLSv1', | |
) | |
} | |
local *LWP::Protocol::https::_extra_sock_opts = \&lwp_58_extra_sock_opts | |
if $LWP::UserAgent::VERSION < 6; | |
my $ua = LWP::UserAgent->new; # &c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment