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";
34 foreach my $x (keys %{$h}) {
35 print $sk $x, $h->{$x}, "\n";
48 if (defined $h->{'-'}) { die "-" . $h->{'-'} . "\n"; }
54 foreach my $x (keys %{$h}) {
55 print $x, $h->{$x}, "\n";
59 sendobj({ 'U' => 'testuser' });
62 #sendobj({ '!' => 'SUBMIT', 'T' => 'plans', 'S' => 100, 'X' => 'c' });
65 #foreach my $x (1..98) { print $sk "."; }
69 sendobj({ '!' => 'STATUS' });