my $client = IO::Socket::SSL->new( # where to connect PeerHost => "example/gettoken", PeerPort => "https" SSL_cert_file => $cert_file, # typical CA file on BSD SSL_passwd_cb => sub {"secret_key"}, ) or die "failed connect or ssl handshake: $!,$SSL_ERROR"; # send and receive over SSL connection print $client "GET / HTTP/1.0\r\n\r\n"; print <$client>;