#!/usr/bin/perl -w my $method = (@ARGV && $ARGV[0] =~ /^[A-Z]+$/) ? shift : "HEAD"; my $host = shift || "shop.sol.no"; my $port = shift || 443; use Net::SSL; $sock = Net::SSL->new(PeerAddr => $host, PeerPort => $port, ) || die "Can't connect to $host:$port"; print "CIPHER: ", $sock->get_cipher, "\n"; $cert = $sock->get_peer_certificate; print "THIS IS: ", $cert->subject_name, "\n"; print "CERTIFIED BY: ", $cert->issuer_name, "\n"; print "\n"; $sock->print("$method / HTTP/1.0\n\n"); $buf = ''; while ($sock->read($buf, 1024)) { print $buf; }