Subject: | Ssl => 1 connection failures don't show helpful errors |
Consider the following:
#!/usr/bin/env perl
use strict;
use warnings;
use Mail::IMAPClient;
Mail::IMAPClient->new(
Server => 'www.pcwebshop.co.uk',
Port => 443,
User => 'test',
Password => 'test',
Ssl => 1,
) or die "Failed: $@\n";
If you run it, it outputs:
Failed: Unable to connect to www.pcwebshop.co.uk:
I wonder if Mail::IMAPClient should be inspecting $SSL_ERROR from IO::Socket::SSL (which contains the helpful info: "hostname verification failed").
Alternatively, perhaps Mail::IMAPClient should just document that if one is using Ssl => 1, they should also load IO::Socket::SSL and inspect $SSL_ERROR.
Thanks,
-- Matthew Horsfall (alh)