pp2@nereida:~/src/perl/SOCKETS$ cat -n sslclient2.pl 1 #!/usr/local/bin/perl -w 2 use strict; 3 use IO::Socket::SSL; 4 5 my $url = shift || "some.shtml.web.server"; 6 my $client = new IO::Socket::SSL("$url:https"); 7 8 if (defined $client) { 9 print $client "GET / HTTP/1.0\r\n\r\n"; 10 print <$client>; 11 close $client; 12 } else { 13 warn "I encountered a problem: ", 14 IO::Socket::SSL::errstr(); 15 }
pp2@nereida:~/src/perl/SOCKETS$ ./sslclient2.pl | head -10 HTTP/1.1 200 OK Date: Tue, 10 Apr 2007 16:24:34 GMT Server: Apache/2.0.54 (Debian GNU/Linux) PHP/4.3.10-18 mod_ssl/2.0.54 \ OpenSSL/0.9.7e mod_perl/1.999.21 Perl/v5.8.4 Last-Modified: Wed, 11 Jan 2006 09:57:56 GMT ETag: "1bf22-148a-4427f100" Accept-Ranges: bytes Content-Length: 5258 Connection: close Content-Type: text/html
Casiano Rodríguez León