sub accept_hook { my $self = shift; my $fh = $self->stdio_handle; $self->SUPER::accept_hook(@_); my $pid = fork(); if ($pid == 0) { my $newfh = IO::Socket::SSL->start_SSL( $fh, SSL_server => 1, SSL_use_cert => 1, SSL_cert_file => '/etc/xen0d/xen0d.crt', SSL_key_file => '/etc/xen0d/rsa_private.key', ) or warn "problem setting up SSL socket: " . IO::Socket::SSL::errstr(); $self->stdio_handle($newfh) if $newfh; } }