my $client = IO::Socket::SSL->new("$ip:$port"); if ($client) { print join( "\t", $host, $interface, $ip, $port, map( $client->peer_certificate($_), qw(authority owner commonName subjectAltNames) ) ), "\n"; } else { print join( "\t", $host, $interface, $ip, $port, 'no connection' ), "\n"; }