in reply to Cannot disable SSL certificate checking when using VPN

<TITLE>Untrusted SSL Server Certificate</TITLE>

LWP::UserAgent does not return HTML content in its error cases, so your (employers) VPN creates that HTML.

Maybe if your code behaves more like Curl, it will be let through? Have you tried to set the appropriate HTTP headers? Especially setting the User-Agent header to something like curl/7.55.1 might already be enough.

Compare what curl sends with what LWP::UserAgent sends, maybe through LWP::ConsoleLogger.

Replies are listed 'Best First'.
Re^2: Cannot disable SSL certificate checking when using VPN
by alain_desilets (Beadle) on Jan 09, 2019 at 20:16 UTC

    Thx Corion. I suspected that the HTML response (the one containing an error message) was generated by my employe's VPN, but I wasn't 100% sure.

    TThe script runs fine today, and I am not sure exactly what fixed it. Here is what I did:

    - Upgraded OSX from El Capitan to Mojave
    - Reinstalled Perl and all my apps required libraries using perlbrew

    I suspect that I was using a very old version of the SSL support libraries and that it wasn't compatible with my employee's VPN. By upgrading OSX and redoing the Perl instllation, I probably ended up installing a more recent version.

    It could also be that my employer changed something in its VPN, which is also plausible because this is the start of the year, and they may need to upgrade a bunch of things. But I lean more towards the first explanation (me upgrading the SSL libraries).