Does the following log suggest that SSL is set after a lot of failed (-1) attempts but finally the handshake is done?

As far as I recall a -1 isn't a failure. It just indicates that the handshake isn't completed and yet another round of negotiation is required. So the return value 1 just says that the SSH handshake is done, but maybe server and client haven't found a common ground? During the handshake the SSL protocol version / TLS protocol version, the crypto algorithm and its parameters like forward secrecy need to be agreed upon. "Modern" web servers and "modern" LWP should easily find agreeable values, problems arise if an old or unpatched server only supports features which are considered not secure enough by a recent client - or vice versa.

With OpenSSL's s_client you can dig into the steps of the handshake (expect lots of output):

openssl s_client -connect your.server:443 -debug

In reply to Re^3: Net::SSLeay::connect -> -1 by haj
in thread Net::SSLeay::connect -> -1 by bliako

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.