IO::Socket::SSL: Bad protocol 'tcp'

Hi ,
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:
$@\n");
   }
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 ?

Thanks& Regards
Aravind



		
__________________________________ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs
0
aravindjp
10/21/2005 12:17:25 PM
perl.ldap 1263 articles. 0 followers. Follow

1 Replies
717 Views

Similar Articles

[PageSpeed] 18

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:
> $@\n");
>    }
> 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: peter@adpm.de
0
peter
10/23/2005 10:53:38 AM
Reply:

Similar Artilces:

''''''''''''''''''''
Name: haznen Email: haznenatyahoodotcom Product: Gran Paradiso Alpha 8 Summary: '''''''''''''''''''' Comments: '''''''''''''''''''''''''''''''''''' Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061204 UGES/1.7.2.0 GranParadiso/3.0a1 From URL: http://www.mozilla.org/projects/granparadiso/ Note to readers: Hendrix gives...

Bad Protocol 'tcp'
I'm attemping to use LWP from my ISP that uses CPanel 5.0 and virtual hosting. When I try to use any LWP functions they all fail with the error: 500 Can't connect to www.somewhere.com:80 (Bad protocol 'tcp') I can use my simple test script from other hosted domains using CPanel 5.0 What does this mean? What is wrong with my ISPs server? He says he doesn't have a clue. perldiver.pl reports: Perl Executable: /usr/bin/perl Perl Version: 5.006001 PERL compile version OS: linux GID: (If not blank, you are on a machine that supports membership in mu...

'''''
Name: mario Email: ramar17atfastwebnetdotit Product: Gran Paradiso Alpha 2 Summary: ''''' Comments: K: Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2) Gecko/20070206 GranParadiso/3.0a2 ...

Method 'send' not found for invocant of class 'IO::Socket::INET'
--089e0102ef549874460520a3c043 Content-Type: text/plain; charset=UTF-8 In the cloned repository of Bailador I ran perl6 examples/app.pl It launched the web server printing Entering the development dance floor: http://0.0.0.0:3000 [2015-09-26T10:04:46Z] Started HTTP server. but when I tried to access it with a browser it crashed with: [2015-09-26T10:04:49Z] GET / HTTP/1.1 Method 'send' not found for invocant of class 'IO::Socket::INET' in method run at /Users/gabor/rakudo-star-2015.09/install/share/perl6/lib/HTTP/Easy.pm6:193 in sub baile at /Users/ga...

Net::DIvert v 1.2: IO-1.2301, problem with 'divert' protocol not being handled by IO::Socket::INET
--0-611687058-1209183203=:90955 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hello, I run Perl v5.8.8 on Debian Etch (custom kernel and iptables). The Divert.pm module line 109, should be modified to read: $self->{SOCK} = IO::Socket::INET->new(LocalHost => $host, LocalPort => $port, Type => IO::Socket::SOCK_RAW, ...

Getting (Bad protocol 'tcp') errors under Solaris
--nextPart5592645.ZYMlcV9hof Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I've got a small script that uses LWP::UserAgent that all of a sudden, or s= o=20 it seems, just stopped working. It simply takes a file and tries to upload = it=20 to a CGI. It works under Linux and some of my other Solaris boxes, but this= =20 one particular machine gives me this error: dnmcimincw13:web# ./foo.pl moo.zip CONTENT: 500 (Internal Server Error) Can't connect to rt.innocent.com:443 (= Bad=20 protoc...

simple tcp socket server:Is it possible, server wait for '!' sign, not '\n'?
Hi all, i need write script to get string like $355632000166323,1,1,040202,093633,E12129.2252,N2459.8891,00161,0.0100,147,07*37! from TCP client. All is fine if client send ENTER after string, but this string have no CR/LF at end. Is it possible, server wait for '!' sign, not '\n'? The code: #!perl use IO::Socket; $PORT = 5001; # pick something not in use $server = IO::Socket::INET->new( Proto => 'tcp', LocalPort => $PORT, Listen => SOMAXCONN, ...

'do' won't 'do' if '/'
Greetings to All from Au, Have a NetWare Perl 5.8.4 and wanted to tweak File\Spec\NW.pm to try and standardise on '/' separators. If I run a test script (t/uni/lower.t) with an unmodified NW.pm, it calls t/uni/case.pl, that, in case.pl, (when the path separators are '\'), the $file is '..\lib\unicore\To\Lower.pl' and the following code portion works, with $simple getting a returned table: sub casetest { my ($base, $spec, $func) = @_; my $file = File::Spec->catfile(File::Spec->catdir(File::Spec->updir, "lib", &qu...

'''
Name: L Lachowsky Email: e2brutus_10atyahoodotcom Product: Firefox Summary: ''' Comments: why duddn this surprise me... I change default server from IE to Mozilla, and then i get error messages. well, shud I decide to not get on my computer with Mozilla..or shud I risk security breeches with IE....hmmm at least i can get on the internet with IE Browser Details: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this fee...

RE: Getting (Bad protocol 'tcp') errors under Solaris
Michael J. Freeman wrote: > I've got a small script that uses LWP::UserAgent that all of a > sudden, or so it seems, just stopped working. It simply takes a file > and tries to upload it to a CGI. It works under Linux and some of my > other Solaris boxes, but this one particular machine gives me this > error:=20 >=20 > dnmcimincw13:web# ./foo.pl moo.zip > CONTENT: 500 (Internal Server Error) Can't connect to > rt.innocent.com:443 (Bad protocol 'tcp') > Content-Type: text/plain Hmmm... Well, 443 is the default port for https traffic....

Cast from type ''''DBNull'''' to type ''''String'''' is not valid.
How do I avoid getting this error: Cast from type ''''DBNull'''' to type ''''String'''' is not valid. I am trying to get values from the database into a form for updating using a Datareader, SQL is set to allow nulls for certain fields as they are not required but the only way I can get the form to display is by adding a space in SQL. Is there another way around this? Check if it is equal to DBNull.Value first and if it is, don't do the cast.Stanley Tan theSpoke Blog Where in the code does it need to go? I am using the following and it's the profile that isn't always requi...

table_info('','','','%') cannot return any types
I was recently confirming table_info special cases and discovered the case for getting table_types cannot work. table_info('','','','%') should return a list of table types but it returns a list of empty strings instead: my @types = $h->tables('', '', '', '%'); print "all types:\n", join("xxx\n", @types), "\n"; # should output something like: # "dbo" # "INFORMATION_SCHEMA" # "sys" # and actually outputs: xxx xxx It seems to be down to the following ...

'IN' Clause or 'OR'
Hello, [1]: select * from TABLEA where COL1 IN('value1','value2''valu3'....) [2]:select * from TABLEA where COL1 = 'value1' OR COL1= 'value2' OR COL1='valu3'. TABLEA is a huge table and it has non-clustered index on COL1. Among the above 2 queries, which query will give me the better performance or fast response and WHY? What is the difference between 'IN' and 'OR' clauses as for as Sybase Optimization is concerned. Which is the better one to be used on huge tables. Thanks. Mac An IN list is treated ...

'or' or 'union'
Hello I was just wondering, in general what is better to use, an 'or' clause in a select or a 'union' to join two selects together. Do both statements create work tables? Many thanks Alex I think OR will be better than union. because suppose u have 3 tables and using OR u can join table a and table b and table c so each table will have only one read. but using union you will join table a and table b and in another query of union u will use table (a or b) and table c so ur one read is more in union . Ramdas Alex Cheung wrote: > Hello > >...

Web resources about - IO::Socket::SSL: Bad protocol 'tcp' - perl.ldap

Resources last updated: 1/9/2016 8:21:51 PM