I'm having trouble getting my perl to connect to my openldap server.

My code is running on a RedHat Enterpise 6 machine that has openssl 1.0 installed.

Here's my connect code:

$ldap = Net::LDAPS->new( $server, port=>636, verify=>'require', capath=>'/path/here/ssl/cacerts/' ) or die("$@");

And here's the error I'm getting:

IO::Socket::SSL: SSL connect attempt failed with unknown errorerror:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed at LDAP.pm line 28, <DATA> line 522.

(LDAP.pm is an LDAP utility module that I wrote for internal use.)

One final bit of information: if I use the ldapsearch command line tool, I can connect to the server just fine.

I'm beating my head against my wall, and I'd appreciate any ideas.

Thanks!


In reply to Error connecting to LDAP via Net::LDAPS by greg_coates

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.