New, TLSv1/SSLv3, Cipher is AES256-SHA
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
SSL-Session:
Protocol : TLSv1
Cipher : AES256-SHA
Session-ID: 8FA80F5DE8D33D29B20AE38665A96F1EE29517E229038F6EDDE9D8CA294DFEF8
Session-ID-ctx:
Master-Key: D1E833AEFD8C0D9345BAD5996ED1B1D0D6E8F58CABBCAE47071B150B49AD510A1A2D4075719C5296D01FDDBA3DFD67C3
Key-Arg : None
Start Time: 1425321673
Timeout : 300 (sec)
Verify return code: 0 (ok)
####
Newton:salesforce_work tpl$ perl -MIO::Socket::SSL=debug30 Testcase
DEBUG: .../IO/Socket/SSL.pm:2602: new ctx 140688297857808
DEBUG: .../IO/Socket/SSL.pm:542: socket not yet connected
DEBUG: .../IO/Socket/SSL.pm:544: socket connected
DEBUG: .../IO/Socket/SSL.pm:566: ssl handshake not started
DEBUG: .../IO/Socket/SSL.pm:608: not using SNI because openssl is too old
DEBUG: .../IO/Socket/SSL.pm:653: set socket to non-blocking to enforce timeout=120
DEBUG: .../IO/Socket/SSL.pm:667: Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:677: ssl handshake in progress
DEBUG: .../IO/Socket/SSL.pm:687: waiting for fd to become ready: SSL wants a read first
DEBUG: .../IO/Socket/SSL.pm:707: socket ready, retrying connect
DEBUG: .../IO/Socket/SSL.pm:667: Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:677: ssl handshake in progress
DEBUG: .../IO/Socket/SSL.pm:687: waiting for fd to become ready: SSL wants a read first
DEBUG: .../IO/Socket/SSL.pm:707: socket ready, retrying connect
DEBUG: .../IO/Socket/SSL.pm:667: Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:677: ssl handshake in progress
DEBUG: .../IO/Socket/SSL.pm:687: waiting for fd to become ready: SSL wants a read first
DEBUG: .../IO/Socket/SSL.pm:707: socket ready, retrying connect
DEBUG: .../IO/Socket/SSL.pm:2458: ok=0 cert=140688300414128
DEBUG: .../IO/Socket/SSL.pm:667: Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:1791: SSL connect attempt failed
DEBUG: .../IO/Socket/SSL.pm:1796: SSL connect attempt failed error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
DEBUG: .../IO/Socket/SSL.pm:673: fatal SSL error: SSL connect attempt failed error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
DEBUG: .../IO/Socket/SSL.pm:1780: IO::Socket::INET6 configuration failed
DEBUG: .../IO/Socket/SSL.pm:2635: free ctx 140688297857808 open=140688297857808
DEBUG: .../IO/Socket/SSL.pm:2640: free ctx 140688297857808 callback
DEBUG: .../IO/Socket/SSL.pm:2647: OK free ctx 140688297857808
500 Can't connect to login.salesforce.com:443 (certificate verify failed)
Can't connect to login.salesforce.com:443 (certificate verify failed)
LWP::Protocol::https::Socket: SSL connect attempt failed error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed at /Library/Perl/5.16/LWP/Protocol/http.pm line 47.
####
#!/usr/bin/perl -w
use strict;
use LWP::UserAgent;
use Mozilla::CA;
# To set debug we can run the program like this: perl -MIO::Socket::SSL=debug30 Testcase
# Print versions
#print "LWP::UserAgent->VERSION is " . LWP::UserAgent->VERSION . "\n";
my ($Request, $Reply, $res);
# A User agent for all WWW requests
my $ua = LWP::UserAgent->new( timeout => 120 );
$ua->ssl_opts(
# verify_hostname => 0,
SSL_ca_file => Mozilla::CA::SSL_ca_file(),
SSL_verifycn_scheme => 'http',
SSL_verifycn_name => 'login.salesforce.com',
);
my $LoginXML = <
USERNAME
AUTHCODE
EOF
$Request = HTTP::Request->new(POST => "https://login.salesforce.com/services/Soap/u/22.0");
$Request->header(
'Content-Type' => 'text/xml; charset=UTF-8',
'SOAPAction' => 'login'
);
$Request->content($LoginXML);
# Make the request and check the results
$res = $ua->request($Request);
$Reply= $res->content;
if (!($res->is_success)) {
warn $res->status_line, "\n";
warn $Reply, "\n";
}
else {
warn "The request succeeded\n";
}