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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |