cormanaz has asked for the wisdom of the Perl Monks concerning the following question:
Recently, maybe a month ago, it started throwing error "certificate verify failed." I did some searching around on this error and found this node that says the person solved it by adding ssl_opts => { verify_hostname => 1, SSL_ca_file => '/path/to/servers/ca-bundle'} to LWP::UserAgent->new(). How do I find that path on Windows?#!/usr/bin/perl use strict; use JSON; use Data::Dumper; require LWP::UserAgent; my $plantinfo; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET => 'https://dashboard.myplantlink.com +/api/v1/plants'); $req->authorization_basic('[hide]','[hide]'); my $response = $ua->request($req); if ($response->is_success) { $plantinfo = decode_json $response->decoded_content; } else { print "Error: ",$response->status_line; exit; }
Also it seems strange that the code above was working recently because most of the posts I found on this (including the one linked) are from a couple of years ago. What could have changed?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP::UserAgent certificate verify failed
by noxxi (Pilgrim) on Feb 03, 2017 at 17:59 UTC | |
by cormanaz (Deacon) on Feb 03, 2017 at 18:48 UTC | |
|
Re: LWP::UserAgent certificate verify failed
by Corion (Patriarch) on Feb 03, 2017 at 16:00 UTC | |
by cormanaz (Deacon) on Feb 03, 2017 at 16:20 UTC | |
by poj (Abbot) on Feb 03, 2017 at 17:02 UTC | |
by Corion (Patriarch) on Feb 03, 2017 at 16:31 UTC |