Gorby has asked for the wisdom of the Perl Monks concerning the following question:
Hello Wise Monks. I'm getting an error that I can't connect to my ip using https. Here's my code. I replaced my real ip address with "myipaddress"
$useragent=new LWP::UserAgent; $request=new HTTP::Request('GET', "https://myipaddress/somea +pps/someapp.cgi"); $result=$useragent->request($request); $placibo2[0]=$result->{_content}; if ($placibo2[0]) { print header; print $placibo2[0]; }
Should I set a value for $ENV{ HTTPS_CA_FILE }? If so, what value? I'm using a windows 2012 server to run the perl program. When I try to access https://www.google.com it works. If I try to access https://myipaddress from the browser on the server it works. When I try to access my ipaddress using https using the above code i get:
LWP::Protocol::https::Socket: SSL connect attempt failed with unknown error error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
I also tried the following: $ENV{'PERL_LWP_SSL_VERIFY_HOSTNAME'} = 0 which worked. I was able to access my ip address using the above code but this is not secure and open to man in the middle attack. What should I now do? Thank you in advance for your wisdom.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: https using lwp (WWW::Mechanize)
by Anonymous Monk on Nov 19, 2016 at 03:48 UTC | |
by Gorby (Monk) on Nov 19, 2016 at 04:05 UTC | |
by noxxi (Pilgrim) on Nov 19, 2016 at 08:27 UTC | |
by Anonymous Monk on Nov 19, 2016 at 08:01 UTC |