use Net::SSLeay; use IO::Socket::INET; Net::SSLeay::initialize(); my $sock = IO::Socket::INET->new(PeerAddr=>'server_address:443') or die; my $ctx = Net::SSLeay::CTX_new() or die; Net::SSLeay::CTX_set_options($ctx, &Net::SSLeay::OP_ALL); my $ssl = Net::SSLeay::new($ctx) or die; Net::SSLeay::set_fd($ssl, fileno($sock)) or die; Net::SSLeay::connect($ssl); # The SSL connection is setup. # Here, after some times, the server sent one close nodify # alert record to shutdown its direction of ssl connection. # How to check or read the alert record from the server?