more doc tweaks
Apocalypse
11 years ago
82 | 82 |
$socket = Client_SSLify( $socket, undef, undef, $ctx );
|
83 | 83 |
|
84 | 84 |
NOTE: You can pass the callback anywhere in the arguments, we'll figure it out for you! If you want to call a POE event, please look
|
85 | |
into the postback/callback stuff in POE::Session.
|
|
85 |
into the postback/callback stuff in L<POE::Session>.
|
86 | 86 |
|
87 | 87 |
$socket = Client_SSLify( $socket, $session->callback( 'got_connect' => @args ) );
|
88 | 88 |
|
|
401 | 401 |
|
402 | 402 |
=func SSLify_GetStatus
|
403 | 403 |
|
404 | |
Returns the status of the SSL negotiation/handshake/connection.
|
|
404 |
Returns the status of the SSL negotiation/handshake/connection. See L<http://www.openssl.org/docs/ssl/SSL_connect.html#RETURN_VALUES>
|
|
405 |
for more info.
|
405 | 406 |
|
406 | 407 |
my $status = SSLify_GetStatus( $socket );
|
407 | |
-1 = still in negotiation stage
|
|
408 |
-1 = still in negotiation stage ( or error )
|
408 | 409 |
0 = internal SSL error, connection will be dead
|
409 | 410 |
1 = negotiation successful
|
410 | 411 |
=cut
|
53 | 53 |
my $socket = eval { Server_SSLify( $_[ARG0], sub {
|
54 | 54 |
my( $socket, $status, $errval ) = @_;
|
55 | 55 |
|
56 | |
pass( "SERVER: Got connect hook" );
|
|
56 |
pass( "SERVER: Got callback hook" );
|
57 | 57 |
is( $status, 'OK', "SERVER: Status received from callback is OK" );
|
58 | 58 |
|
59 | 59 |
## At this point, connection MUST be encrypted.
|
|
103 | 103 |
my $socket = eval { Client_SSLify($_[ARG0], sub {
|
104 | 104 |
my( $socket, $status, $errval ) = @_;
|
105 | 105 |
|
106 | |
pass( "CLIENT: Got connect hook" );
|
|
106 |
pass( "CLIENT: Got callback hook" );
|
107 | 107 |
is( $status, 'OK', "CLIENT: Status received from callback is OK" );
|
108 | 108 |
|
109 | 109 |
## At this point, connection MUST be encrypted.
|
85 | 85 |
my $socket = eval { Client_SSLify($_[ARG0], sub {
|
86 | 86 |
my( $socket, $status, $errval ) = @_;
|
87 | 87 |
|
88 | |
pass( "CLIENT: Got connect hook" );
|
|
88 |
pass( "CLIENT: Got callback hook" );
|
89 | 89 |
is( $status, 'ERR', "CLIENT: Status received from callback is ERR - $errval" );
|
90 | |
is( SSLify_GetStatus( $socket ), 0, "CLIENT: SSLify_GetStatus is error" );
|
91 | 90 |
|
92 | 91 |
$poe_kernel->post( 'myclient' => 'shutdown' );
|
93 | 92 |
}) };
|
48 | 48 |
my $socket = eval { Server_SSLify( $_[ARG0], sub {
|
49 | 49 |
my( $socket, $status, $errval ) = @_;
|
50 | 50 |
|
51 | |
pass( "SERVER: Got connect hook" );
|
|
51 |
pass( "SERVER: Got callback hook" );
|
52 | 52 |
is( $status, 'ERR', "SERVER: Status received from callback is ERR - $errval" );
|
53 | |
is( SSLify_GetStatus( $socket ), 0, "SERVER: SSLify_GetStatus is error" );
|
54 | 53 |
|
55 | 54 |
$poe_kernel->post( 'myserver' => 'shutdown');
|
56 | 55 |
} ) };
|
|
111 | 110 |
# The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
|
112 | 111 |
my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
|
113 | 112 |
|
|
113 |
# Since this test purposefully sends garbage, we expect a connection reset by peer
|
|
114 |
# not ok 7 - Got SERVER read error 104: Connection reset by peer
|
|
115 |
|
114 | 116 |
# TODO are there other "errors" that is harmless?
|
115 | 117 |
$error = "Normal disconnection" unless $error;
|
116 | 118 |
my $msg = "Got CLIENT $syscall error $errno: $error";
|
117 | |
unless ( $syscall eq 'read' and $errno == 0 ) {
|
|
119 |
unless ( $syscall eq 'read' and $errno == 104 ) {
|
118 | 120 |
fail( $msg );
|
119 | 121 |
} else {
|
120 | 122 |
diag( $msg ) if $ENV{TEST_VERBOSE};
|