use IO::Socket::SSL qw(debug3); use Net::SSLeay; # simple server my $server = IO::Socket::SSL->new( # where to listen LocalAddr => '127.0.0.1', LocalPort => 5000, Listen => 10, # which certificate to offer # with SNI support there can be different certificates per hostname #verify_mode => Net::SSLeay->VERIFY_PEER(), SSL_cert_file => 'C:/Users/Documents/Private-Public-key-cert/Cert.crt', SSL_key_file => 'C:/Users/Documents/Private-Public-key-cert/Private0504.key', ca_file => 'C:/Users/Documents/Private-Public-key-cert/cacerts', ) or die "failed to listen: $!"; # accept client my $client = $server->accept or die "failed to accept or ssl handshake: $!,$SSL_ERROR";