Greetings Bros. I had a script that was accessing a PlantLink sensor API that was working
#!/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; }
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?

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?

"I think computers have complicated lives very bigly. The whole age of, you know, computer has made it where nobody knows exactly what's going on." --D. Trump

In reply to LWP::UserAgent certificate verify failed by cormanaz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.