use strict; use warnings; use IO::Socket::SSL qw(debug3); my $socket = IO::Socket::SSL->new ( PeerAddr => 'some.server.com', PeerPort => 443, Proto => 'tcp', SSL_use_cert => 1, SSL_verify_mode => SSL_VERIFY_NONE, SSL_cert_file => 'server.pem' ) or die "failed connect or ssl handshake: $!,",&IO::Socket::SSL::errstr,"\n"; #### DEBUG: .../IO/Socket/SSL.pm:251: set domain to 2 DEBUG: .../IO/Socket/SSL.pm:1784: new ctx 41181280 DEBUG: .../IO/Socket/SSL.pm:446: socket not yet connected DEBUG: .../IO/Socket/SSL.pm:448: socket connected DEBUG: .../IO/Socket/SSL.pm:466: ssl handshake not started DEBUG: .../IO/Socket/SSL.pm:501: using SNI with hostname some.server.com DEBUG: .../IO/Socket/SSL.pm:537: Net::SSLeay::connect -> -1 DEBUG: .../IO/Socket/SSL.pm:543: fatal SSL error: SSL connect attempt failed with unknown error DEBUG: .../IO/Socket/SSL.pm:1821: free ctx 41181280 open=41181280 DEBUG: .../IO/Socket/SSL.pm:1829: OK free ctx 41181280 failed connect or ssl handshake: Bad file descriptor,IO::Socket::INET6 configuration failed SSL connect attempt failed with unknown error