use strict; use warnings; use IO::Socket::SSL; $IO::Socket::SSL::DEBUG = 3; my $host = 'letsencrypt.org'; my $client = IO::Socket::SSL->new( # where to connect PeerHost => $host, PeerPort => "https", # -------- test this -------- SSL_ocsp_mode => SSL_OCSP_NO_STAPLE, # certificate verification - VERIFY_PEER is default SSL_verify_mode => SSL_VERIFY_PEER, ) or die "failed connect or ssl handshake: $!,$SSL_ERROR"; # send and receive over SSL connection print $client "GET / HTTP/1.0\r\n"; print $client "Host: $host\r\n\r\n"; print <$client>;