I'm having trouble with LWP::useragent.  I've tested the certificates
using the following command and all is good.  Any ideas?

 

C:\openssl\bin>openssl s_client -connect myserver.com:443 -cert c:\certs
\usercert.pem -key c:\certs\notacakeynopass.pem -CApath c:\certs\trusted

 

The following is what I get with debugging enabled.

 

Failed to get 'https://myserver.com: 500 SSL negotiation failed:
error:1406D0CB:SSL routines:GET_SERVER_HELLO:peer error no cipher

1

SSL_connect:before/connect initialization

SSL_connect:SSLv2/v3 write client hello A

SSL_connect:SSLv3 read server hello A

SSL_connect:SSLv3 read server certificate A

SSL_connect:SSLv3 read server certificate request A

SSL_connect:SSLv3 read server done A

SSL_connect:SSLv3 write client certificate A

SSL_connect:SSLv3 write client key exchange A

SSL_connect:SSLv3 write certificate verify A

SSL_connect:SSLv3 write change cipher spec A

SSL_connect:SSLv3 write finished A

SSL_connect:SSLv3 flush data

SSL3 alert read:fatal:unknown CA

SSL_connect:failed in SSLv3 read finished A

SSL_connect:before/connect initialization

SSL_connect:SSLv3 write client hello A

SSL_connect:SSLv3 read server hello A

SSL_connect:SSLv3 read server certificate A

SSL_connect:SSLv3 read server certificate request A

SSL_connect:SSLv3 read server done A

SSL_connect:SSLv3 write client certificate A

SSL_connect:SSLv3 write client key exchange A

SSL_connect:SSLv3 write certificate verify A

SSL_connect:SSLv3 write change cipher spec A

SSL_connect:SSLv3 write finished A

SSL_connect:SSLv3 flush data

SSL3 alert read:fatal:certificate unknown

SSL_connect:failed in SSLv3 read finished A

SSL_connect:before/connect initialization

SSL_connect:SSLv2 write client hello A

SSL_connect:failed in SSLv2 read server hello A

 

The following is the script:

 

use LWP::UserAgent;

use LWP::Protocol::https;

use Crypt::SSLeay;

 

 

$ENV{HTTPS_CA_DIR}    = 'c:/certs/trusted';

 

#$ENV{HTTPS_VERSION} = '3';

$ENV{HTTPS_DEBUG} = 1;

 

$ENV{HTTPS_CERT_FILE} = 'c:\certs\usercert.pem';

$ENV{HTTPS_KEY_FILE}  = 'c:\certs\notacakeynopass.pem';

 

$user = $ARGV[0];

$password = $ARGV[1];

$teststr = $ARGV[2];

 

my @line=split(/,/,$teststr);

 

$Server = $line[0];

 

my $url = "$Server/eaiservices/svcsindex.jsp";

            

my $ua = LWP::UserAgent->new();

my $req1 = (GET $url);

            

my $response = $ua->request($req1);

            

if ($response->is_success ne 1)

{

print "Failed to get '$url': ", $response->status_line ,"\n";

            print 1;

            undef $ua;

            exit(1);

}

 

Thanks for any help.

Reply via email to