Here is what I have so far and the error I have encountered.
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>;
The above code give an error failed connect or ssl handshake: Invalid argument,IO::Socket::IP configuration failed
When I comment out peerhost and port I nothing happens.
Not sure what to do next. When I print dumper is outputs $VAR1 = bless( \*Symbol::GEN0, 'IO::Socket::SSL' );
Any help is greatly appreciated.
|