Hi All,
I've seen a few posts here and there regarding this, but haven't come to a full solution yet. I have the below code grabbing a URL that has worked great before with HTTP but has since been changed to HTTPS and have a need to still access it this way. I have the latest version of OpenSSL and have install various other packages but nothing seems to be working in conjunction with mechanize. Comes back with the error: Error GETing https://randomurl.com: Can't connect to randomurl:443 (Bad hostname) at script.pl
Any thoughts?
#!/usr/bin/perl
use strict;
use WWW::Mechanize;
use IO::Socket::SSL;
my $url = 'https://randomurl.com';
my $mech = WWW::Mechanize->new;
$mech->credentials( 'username' => 'password' );
$mech->get( $url);