I have the usual headache when trying to send an email from Perl which requires TLS. I'm running Strawberry Perl on a Windows7 machine, and I'm running code that works on other Windows PCs (in the past), so it is basically a configuration issue rather than basic coding, but it is an issue I see happening to other guys quite a bit. I recall in the past I always had problems getting this to run on those PCs also. The code is basically:

$email = new Net::SMTP::TLS($account_smtp,Hello=>$account_smtp, Port=>25,User=>$account_user,Password=>$account_pass);

So the accounts and passwords are correct, as that works on another machine in the company. The initial error I got was: invalid SSL_version specified at C:/strawberry/perl/vendor/lib/IO/Socket/SSL.pm line 418

But I applied the following workaround to C:\strawberry\perl\vendor\lib\Crypt\SSLeay\SSL.pm line 1602:

# old code m{^(!?)(?:(SSL(?:v2|v3|v23|v2/3))|(TLSv1[12]?))$}i # new code m{^(!?)(?:(SSL(?:v2|v3|v23|v2/3))|(TLSv1[12]?))}i

That now seems to work, but I get the following error further down the line: Couldn't start TLS: SSL connect attempt failed with unknown error error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

I also tried updating Crypt::SSLeay in case it was old:

cpan> install Crypt::SSLeay Fetching with LWP: http://cpan.strawberryperl.com/authors/01mailrc.txt.gz Fetching with LWP: http://cpan.strawberryperl.com/modules/02packages.details.txt.gz Fetching with LWP: http://cpan.strawberryperl.com/modules/03modlist.data.gz Database was generated on Thu, 19 Dec 2013 14:05:27 GMT Updating database file ... Done! Crypt::SSLeay is up to date (0.64).

But that made no difference, has anyone got any ideas ?


In reply to Couldn't start TLS: SSL connect attempt failed with unknown error error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed by rich101v2

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.