7 $ssl_ctx=SSL::CTX->new("SSLv3");
9 $ssl_ctx->set_options("-info_callback" =>
11 print STDERR $_[0]->state()."\n";
15 $conn="localhost:4433";
16 $conn=$ARGV[0] if $#ARGV >= 0;
17 $cbio=BIO->new("connect");
18 $cbio->hostname($conn) || die $ssl->error();
20 $ssl=$ssl_ctx->new_ssl;
21 $sbio=BIO->new("ssl");
23 $ssl->set_options("-connect_state");
25 $bio=BIO->new("buffer");
30 ($bio->do_handshake() > 0) || die $bio->error();
32 (($ret=$bio->syswrite("GET / HTTP/1.0\r\n\r\n")) > 0) || die $ssl->error();
33 $bio->flush() || die $bio->error();
36 while ($_=$bio->getline())
45 if ($bio->peek_error())
47 print "There was an error:".$ssl->error();