Hi I have 2 problems which are as listed below:
1.In the first instance i have to check whether the HTTPS
service is running on a remote machine or not.The
following is the code snippet for it:
use LWP::UserAgent; my ($strHttpURL)='https://machinename; $ua = LWP::UserAgent->new; $req = HTTP::Request->new(GET =>$strHttpURL); $res = $ua->request($req); if ($res->is_success) { print ("$strHttpURL connected successfully"); return $TRUE; } else{ print "$strHttpURL not connected"); }
I have secured the https://machinename link. However, the
problem is though i am able to run the above code from
windows, it does not succeed in unix.Also, the
operation succeeds in unix when i try to access any 'http' service.
Is the problem related to some certificate mismatch.

2.The second problem is on the similar lines,here i have to
check whether the LDAPS server is running or not.In
windows i am able to check both the LDP and LDAPS
services. However, in UNIX the LDAP code works fine but
LDAPS again is not able to connect properly.The
following is the code snippet for LDAPS:

use Net::LDAPS; use Net::LDAP; $ldaps = Net::LDAPS->new( $strLDAPIpAdd,port =>$strLDAPPort,onerror=>u +ndef); if ($ldaps==undef) { print("Ip Address of LDAP server over SSL is not correct"); return $ERROR; } $mesg = $ldaps->bind(); if ($mesg->code==0) { print ("LDAP over SSL with ip $strLDAPIpAdd connected successfully!"); $mesg=$ldaps->unbind; } else{ print("LDAP over SSL with ip $strLDAPIpAdd not connected..."); $mesg=$ldaps->unbind; }
I think both the above problems are related.Pls help.
Regds

In reply to Checking HTTPS and LDAPS thru UNIX by Anonymous Monk

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.