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 teh 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=>undef);
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
A

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to