#Server.pl #!/usr/local/bin/perl use strict; use warnings; use IO::Socket::SSL 'inet4'; my $server = IO::Socket::SSL->new( LocalPort=> 42000, ## Type=>SOCK_STREAM, Reuse=>1, Listen=>5, Proto => 'tcp', SSL_use_cert => 1, SSL_verify_mode => 0x00, SSL_key_file => '/home/swilting/perltest/private/localhost.key', SSL_cert_file => '/home/swilting/perltest/certs/localhost.cert', SSL_passwd_cb => sub { return "" }, )or die ("Could not create server"); while(my $client=$server->accept()){ my $child_pid; unless(defined ($child_pid=fork())){die"can not fork\n";} if(defined($child_pid)){ while(my $line = <$client>){ print "CLIENT says:$line\n"; } }else{ while(my $line = <>){ print $client "$line\n"; } } } redo; close($server); <>;