I have seen this old tip.
#!/usr/bin/perl
#The trick here is simply to dynamically change the
#inheritance of HTTP::Daemon to make it an heir
#of IO::Socket::SSL instead of IO::Socket::INET
use HTTP::Daemon;
use IO::Socket::SSL;
@HTTP::Daemon::ISA = qw/ IO::Socket::SSL /;
@HTTP::Daemon::ClientConn::ISA = qw/ IO::Socket::SSL /;
my $server = new HTTP::Daemon
SSL_cert_file => 'cert.pem',
SSL_cert_file => 'key.pm',
LocalPort => 443,
ReuseAddr => 1,
;
while ( my $client = $server->accept() ) {
# do stuff ...
$client->close(SSL_no_shutdown => 1);
}
$server->close(SSL_no_shutdown => 1);