I have a perl script which downloads email from pop.gmail.com:995 using the CPAN Mail::Box::POP3s package. The source code to do this is:
my $pop = Mail::Box::POP3s->new(username => $recordsUser,
password => $recordsPassword,
server_name => $pop3Server);
my($nrOfMsgs) = $pop->nrMessages;
print "Received $nrOfMsgs\n";
On one Windows 10 system, this works perfectly. But on another it fails, with the signature:
DEBUG: .../IO/Socket/SSL.pm:1890: new ctx 76411024
DEBUG: .../IO/Socket/SSL.pm:393: socket not yet connected
DEBUG: .../IO/Socket/SSL.pm:395: socket connected
DEBUG: .../IO/Socket/SSL.pm:413: ssl handshake not started
DEBUG: .../IO/Socket/SSL.pm:443: using SNI with hostname pop.gmail.com
DEBUG: .../IO/Socket/SSL.pm:479: Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:1359: SSL connect attempt failed with unknown error
DEBUG: .../IO/Socket/SSL.pm:485: fatal SSL error: SSL connect attempt failed with unknown error error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
DEBUG: .../IO/Socket/SSL.pm:1924: free ctx 76411024 open=76411024
DEBUG: .../IO/Socket/SSL.pm:1932: OK free ctx 76411024
ERROR: Cannot connect to pop.gmail.com:995 for POP3: Bad file descriptor
ERROR: Cannot create POP3 client for inbox.
Can't call method "nrMessages" on an undefined value at ./emailToNotes.pl line 110.
Both the systems are running Windows10 Pro (uptodate as of 2019) with Active Perl 5.16.3. On the system that works, I have: IO::Socket::SSL version 1.84 Net::SSLeay version 1.52 Openssl version 1.02 On the system that fails, I have: IO::Socket::SSL version 1.962 Net::SSLeay version 1.55 Openssl verson 1.1.1d Looking at all the previous mentions of this error syndrome on the web, I tried: - patching IO::Socket::SSL to set $can_client_sni to 0 - downloading the trusted CA chain from https://curl.haxx.se/ca/cacert.pem, and add it to Net::SSLeay with the call Net::SSLeay::X509_STORE_add_crl None of these solve the problem. The only difference in the Windows 10 of the two systems is that the working one had Windows 10 Pro installed in 2018, while the new system was just purchased 2 weeks ago. I have been trying different solutions for 2 days now, and could surely use some help from experts such as Steffen Ullrich and others. Thanks in advance.
Net::SSLeay::X509_STORE_add_crldoes not add any trusted certificates but it adds CRL. Moreover it is unclear which SSL store you've used here. - Steffen Ullrich