I'm writing a Perl application to test the REST API of a JIRA server we're using. Somehow I can't seem to be able to establish an SSL connection to the server. I have the following code

use strict; use warnings; use LWP; use JIRA::REST; my $browser = LWP::UserAgent->new; $browser->proxy(['http','https'],'http://myproxy:8080'); $browser->agent("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20 +100101 Firefox/38.0"); my %client = ('useragent' => $browser); my $clientref = \%client; my $jira = JIRA::REST->new('https://myurl:8443/jira', 'myuser', 'mypas +s', $clientref); print $jira->GET("/issue/myissue");
I had to edit some parts because of confidentiality.
When I try to run this simple script I get the following error message:
Can't connect to myurl:8443 (certificate verify failed) LWP::Protocol::https::Socket: SSL connect attempt failed error:1409008 +6:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed +at /home/myhome/perl5/lib/perl5/LWP/Protocol/http.pm

The strange thing is, that this error message is not consistent. F.e. just a few minutes ago it gave me this error without editing anything in the script

JIRA::REST Error[500 - Internal Server Error]: SSL negotiation failed: error:1406D0CB:SSL routines:GET_SERVER_HELLO:p +eer error no cipher at /home/myhome/perl5/lib/perl5/LWP/Protocol/http +.pm

I assume that my script isn't able to fetch the certificate from the server, but how do I edit my script to make it at least connect for now?
I've tried debugging with the analyze-ssl.pl, but it doesnt work either, as the script doesn't accept the syntax of my proxy. I've tried reprogramming it, but without success.


In reply to Inconsistent errors when trying to establish SSL-connection by ddominnik

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.