NAME

POE::Component::SSLify - Makes using SSL in the world of POE easy!

SYNOPSIS

# Import the module
use POE::Component::SSLify;

# Create a normal SocketFactory wheel or something
my $factory = POE::Wheel::SocketFactory->new( ... );

# Converts the socket into a SSL socket POE can communicate with
eval { $socket = SSLify( $socket ) };
if ( $@ ) {
	# Unable to SSLify it...
}

# Now, hand it off to ReadWrite
my $rw = POE::Wheel::ReadWrite->new(
	Handle	=>	$socket,
	...
);

# Use it as you wish...

ABSTRACT

Makes SSL use in POE a breeze!

CHANGES

0.01

Initial release

DESCRIPTION

This component represents the standard way to do SSL in POE.

The standard way to use this module is to do this:

use POE::Component::SSLify;
$sslsock = SSLify( $socket );

Oh, you want to set some SSL options? Then read up Net::SSLeay's POD and figure it out :)

NOTES

Dying everywhere...

This module will die() if Net::SSLeay could not be loaded or it is not the version we want. So, it is recommended that you check for errors and not use SSL, like so:

eval { use POE::Component::SSLify };
if ( $@ ) {
	$sslavailable = 0;
} else {
	$sslavailable = 1;
}

# Make socket SSL!
if ( $sslavailable ) {
	eval { $socket = SSLify( $socket ) };
	if ( $@ ) {
		# Unable to SSLify the socket...
	}
}

Server SSL Sockets

This is not designed to be used in server/listening SSL sockets ( Because I haven't tested that ). Various POE developers believe that in order to have a SSL server, you would need to set up a server certificate, among other things. However, if this module magically works for you, let me know!

This module did not undergo "serious" testing, other than simple connections to verify that the SSL part works...

For further exploration, it is recommended to read the EXAMPLES section of Net::SSLeay's POD and study how they do server sockets, I will work on this when I have the time, but patches are welcome :)

FUNCTIONS

There's only one function: SSLify()

Accepts a socket, SSLifies it, then returns a brand-new SSL-enabled socket!

It might not be desirable, but SSLify() will die() if it is not able to do it's job...

EXPORT

Exports one function by force: SSLify()

SEE ALSO

POE

Net::SSLeay

AUTHOR

Apocalypse <apocal@cpan.org>

PROPS

	Original code is entirely Rocco Caputo ( Creator of POE ) -> I simply
	packaged up the code into something everyone could use and accepted the burden
	of maintaining it :)

	From the PoCo::Client::HTTP code =]
	# TODO - This code should probably become a POE::Kernel method,
    	# seeing as it's rather baroque and potentially useful in a number
    	# of places.

COPYRIGHT AND LICENSE

Copyright 2004 by Apocalypse/Rocco Caputo

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.