Codebase list libpoe-component-sslify-perl / d78ae1e
cleanup stuff after git import Apocalypse 14 years ago
6 changed file(s) with 30 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
0 # Build.PL
01 use Module::Build;
2
13 my $build = Module::Build->new(
24 # look up Module::Build::API for the info!
35 'dynamic_config' => 0,
1921 'Net::SSLeay' => '1.30',
2022
2123 # Test stuff
22 'Test::More' => 0,
23 },
24
25 'recommends' => {
26 # boo!
24 'Test::More' => '0.86', # require latest for note() support in t/a_is_prereq_outdated.t
2725 },
2826
2927 # FIXME wishlist...
4442 # 'Test::Prereq' => 0,
4543 # 'Test::Strict' => 0,
4644 # 'Test::UseAllModules' => 0,
45 # 'Test::YAML::Meta' => 0,
4746 # },
4847 );
4948
00 Revision history for Perl extension POE::Component::SSLify.
1
2 * 0.15
3
4 Added "examples/serverclient.pl" to track down same-process sslification problems, thanks LotR!
15
26 * 0.14
37
3333 # ARG0 = Socket, ARG1 = Remote Address, ARG2 = Remote Port
3434 my $socket = $_[ ARG0 ];
3535
36 # testing stuff
37 warn "got connection from: " . inet_ntoa( ( unpack_sockaddr_in( getpeername( $socket ) ) )[1] ) . " - commencing Server_SSLify()";
38
3639 # SSLify it!
3740 $socket = Server_SSLify( $socket );
3841
3942 # testing stuff
40 warn "got connection from: " . inet_ntoa( ( unpack_sockaddr_in( getpeername( SSLify_GetSocket( $socket ) ) ) )[1] ) . " cipher type: " . SSLify_GetCipher( $socket );
43 warn "SSLified: " . inet_ntoa( ( unpack_sockaddr_in( getpeername( SSLify_GetSocket( $socket ) ) ) )[1] ) . " cipher type: " . SSLify_GetCipher( $socket );
4144
4245 # Hand it off to ReadWrite
4346 my $wheel = POE::Wheel::ReadWrite->new(
4548 'Driver' => POE::Driver::SysRW->new(),
4649 'Filter' => POE::Filter::Line->new(),
4750 'InputEvent' => 'Got_Input',
48 'FlushedEvent' => 'Got_Flush',
4951 'ErrorEvent' => 'Got_Error',
5052 );
5153
5254 # Store it...
5355 $_[HEAP]->{'WHEELS'}->{ $wheel->ID } = $wheel;
54 return 1;
56 return;
5557 },
5658 'ListenerError' => sub {
5759 # ARG0 = operation, ARG1 = error number, ARG2 = error string, ARG3 = wheel ID
5860 my ( $operation, $errnum, $errstr, $wheel_id ) = @_[ ARG0 .. ARG3 ];
5961 warn "SocketFactory Wheel $wheel_id generated $operation error $errnum: $errstr\n";
6062
61 return 1;
63 return;
6264 },
6365 'Got_Input' => sub {
6466 # ARG0: The Line, ARG1: Wheel ID
6567
6668 # Send back to the client the line!
6769 $_[HEAP]->{'WHEELS'}->{ $_[ARG1] }->put( $_[ARG0] );
68 return 1;
69 },
70 'Got_Flush' => sub {
71 # We don't care about this event
72 return 1;
70 return;
7371 },
7472 'Got_Error' => sub {
7573 # ARG0 = operation, ARG1 = error number, ARG2 = error string, ARG3 = wheel ID
7876
7977 # Done with a wheel
8078 delete $_[HEAP]->{'WHEELS'}->{ $_[ARG0] };
81 return 1;
79 return;
8280 },
8381 },
8482 );
9795
9896 # Connect to the server!
9997 $_[KERNEL]->yield( 'do_connect' );
100 return 1;
98 return;
10199 },
102100 'do_connect' => sub {
103101 # Create the socketfactory wheel to listen for requests
108106 'SuccessEvent' => 'Got_Connection',
109107 'FailureEvent' => 'ConnectError',
110108 );
111 return 1;
109 return;
112110 },
113111 'Got_ReadLine' => sub {
114112 if ( defined $_[ARG0] ) {
120118 die 'stopped';
121119 }
122120 }
121 return;
123122 },
124123 'Got_Connection' => sub {
125124 # ARG0 = Socket, ARG1 = Remote Address, ARG2 = Remote Port
126125 my $socket = $_[ ARG0 ];
127126
127 warn "Connected to server, commencing Client_SSLify()";
128
128129 # SSLify it!
129130 $socket = Client_SSLify( $socket );
131
132 warn "SSLified the connection to the server";
130133
131134 # Hand it off to ReadWrite
132135 my $wheel = POE::Wheel::ReadWrite->new(
142145 $_[HEAP]->{'RL'}->put( 'Connected to SSL server' );
143146 $_[HEAP]->{'RL'}->get( 'Input: ' );
144147
145 return 1;
148 return;
146149 },
147150 'ConnectError' => sub {
148151 # ARG0 = operation, ARG1 = error number, ARG2 = error string, ARG3 = wheel ID
151154 delete $_[HEAP]->{'SOCKETFACTORY'};
152155 $_[HEAP]->{'RL'}->put( 'Unable to connect to SSL server...' );
153156 $_[KERNEL]->delay_set( 'do_connect', 5 );
154 return 1;
157 return;
155158 },
156159 'Got_Input' => sub {
157160 # ARG0: The Line, ARG1: Wheel ID
159162 # Send back to the client the line!
160163 $_[HEAP]->{'RL'}->put( 'Got Reply: ' . $_[ARG0] );
161164 $_[HEAP]->{'RL'}->get( 'Input: ' );
162 return 1;
165 return;
163166 },
164167 'Got_Error' => sub {
165168 # ARG0 = operation, ARG1 = error number, ARG2 = error string, ARG3 = wheel ID
168171 delete $_[HEAP]->{'WHEEL'};
169172 $_[HEAP]->{'RL'}->put( 'Disconnected from SSL server...' );
170173 $_[KERNEL]->delay_set( 'do_connect', 5 );
171 return 1;
174 return;
172175 },
173176 },
174177 );
33
44 # Initialize our version
55 use vars qw( $VERSION );
6 $VERSION = (qw$LastChangedRevision: 53 $)[1];
6 $VERSION = '55';
77
88 # Import the SSL death routines
99 use Net::SSLeay qw( die_now die_if_ssl_error );
33
44 # Initialize our version
55 use vars qw( $VERSION );
6 $VERSION = (qw$LastChangedRevision: 53 $)[1];
6 $VERSION = '55';
77
88 # Import the SSL death routines
99 use Net::SSLeay qw( die_now die_if_ssl_error );
33
44 # Initialize our version $LastChangedRevision: 53 $
55 use vars qw( $VERSION );
6 $VERSION = '0.14';
6 $VERSION = '0.15';
77
88 # We need Net::SSLeay or all's a failure!
99 BEGIN {