Net::Server::Proto::SSL3pm
Net::server ssl protocol.
Usage
Until this release, it was preferable to use the Net::Server::Proto::SSLEAY module. Recent versions include code that overcomes original limitations.
See Net::Server::Proto. See Net::Server::Proto::SSLEAY.
use base qw(Net::Server::HTTP);main->run(proto => 'ssl',SSL_key_file => "/path/to/my/file.key",SSL_cert_file => "/path/to/my/file.crt",);# ORsub SSL_key_file { "/path/to/my/file.key" }sub SSL_cert_file { "/path/to/my/file.crt" }main->run(proto = 'ssl');# ORmain->run(port => [443, 8443, "80/tcp"], # bind to two ssl ports and one tcpproto => "ssl", # use ssl as the defaultipv => "*", # bind both IPv4 and IPv6 interfacesSSL_key_file => "/path/to/my/file.key",SSL_cert_file => "/path/to/my/file.crt",);# ORmain->run(port => [{port => "443",proto => "ssl",# ipv => 4, # default - only do IPv4SSL_key_file => "/path/to/my/file.key",SSL_cert_file => "/path/to/my/file.crt",}, {port => "8443",proto => "ssl",ipv => "*", # IPv4 and IPv6SSL_key_file => "/path/to/my/file2.key", # separate keySSL_cert_file => "/path/to/my/file2.crt", # separate certSSL_foo => 1, # Any key prefixed with SSL_ passed as a port hashref# key/value will automatically be passed to IO::Socket::SSL}]);
Overview
Protocol module for Net::Server based on IO::Socket::SSL. This module implements a secure socket layer over tcp (also known as SSL) via the IO::Socket::SSL module. If this module does not work in your situation, please also consider using the SSLEAY protocol (Net::Server::Proto::SSLEAY) which interfaces directly with Net::SSLeay. See Net::Server::Proto.
If you know that your server will only need IPv4 (which is the default for Net::Server), you can load IO::Socket::SSL in inet4 mode which will prevent it from using IO::Socket::IP or IO::Socket::INET6 since they would represent additional and unused overhead.
use IO::Socket::SSL qw(inet4);use base qw(Net::Server::Fork);__PACKAGE__->run(proto => "ssl");
Parameters
In addition to the normal Net::Server parameters, any of the SSL parameters from IO::Socket::SSL may also be specified. See IO::Socket::SSL for information on setting this up. All arguments prefixed with SSL_ will be passed to the IO::Socket::SSL->configure method.
Licence
Distributed under the same terms as Net::Server
Thanks
Thanks to Vadim for pointing out the IO::Socket::SSL accept was returning objects blessed into the wrong class.
Releases
12 releases since Debian 3.1 (Sarge); the text changed 10 times.