7 use IO::Socket::SSL; # qw(debug3);
9 my $sk = new IO::Socket::INET(
10 # PeerAddr => "nikam.ms.mff.cuni.cz:443",
11 PeerAddr => "localhost:8888",
13 ) or die "Cannot connect to server: $!";
16 defined $z or die "Server failed to send welcome message\n";
17 $z =~ /^\+/ or die "Server reported error: $z";
21 $sk = IO::Socket::SSL->start_SSL(
23 SSL_version => 'TLSv1',
25 SSL_key_file => "client-key.pem",
26 SSL_cert_file => "client-cert.pem",
27 SSL_ca_file => "ca-cert.pem",
29 ) or die "Cannot establish TLS connection: " . IO::Socket::SSL::errstr() . "\n";
32 print $sk "Hello, world!\n";