Hi, On Friday, 21. October 2005 14:17, Aravind J wrote: > I am relatively new to LDAP, I am trying a piece of > perl code to connect to a LDAP server.But getting some > error which really put me into trouble.I am geeting an > error > > "IO::Socket::SSL: Bad protocol 'tcp'" > > I am working on Solaris 9 OS, > Here is my perl code > > my $LDAPServer = 'ldaps://xxxx'; > my $name = xxxxx; > > # Get LDAP dn for current user > my $ldap = Net::LDAPS->new($LDAPServer, version => > 3); > if (!defined($ldap)) { > error(new CGI,"Failed to connect to LDAP server: > [EMAIL PROTECTED]"); > } > I am getting an Error > "IO::Socket::SSL: Bad protocol 'tcp'" > > could you please help me to sort out this issue, I > don't know how to debug this , is there any way to > debug this issue ?
I have searched for the error message in question. The only place this string appears is in IO::Socket::INET, which IIRC is the base class of IO::Socket::SSL. The code leading to the error message in IO::Socket::INET is expecting the protocol being numeric. In your case it isn't and so the code throws the error you notice. I cannot tell exactly where the problem is, but the text string 'tcp' for the protocol provided by Net::LDAPS is converted to the appropriate protocol number in normal ("healthy") enviroments. I don't know if it is done in the Perl environment itself or using the system's name service switch facilities. Here are a few hints to search further - Do you have a file /etc/protocols - What does the command 'getent protocols tcp' produce ? In any case I am convinced the error has nothing to do with NetLDAP. Hope it helps Peter -- Peter Marschall eMail: [EMAIL PROTECTED]