Ruby net/ldap, LDAP PDU error

I have a problem here. I am trying to connect to a LDAP server (IBM’s
Tivoli to be exact) to automate a process that will export the schema in
LDIF format. I am able to bind to Active directory with no problems
using the standard example.

Versions: Ruby 1.8.6 patchlevel 287 Ruby-net-ldap 0.0.4 rubygems 1.3.5

ldap = :host => server, :port => ADSettings.port,
:encryption => :simple_tls)

ldap.authenticate ADSettings.username, ADSettings.password

if ldap.bind





However when I attempt to bind to this Tivoli server, I get the

`initialize’: ldap-pdu format error (Net::LdapPd

Here is my sample script.

require ‘rubygems’
require ‘net/ldap’

binddn = “uid=admin,dc=company,dc=com”
bindpass = ‘password’

ldap = :host => ‘’,:port => 11636,
:auth => {:method => :simple, :username => binddn,:password =>

ldap_filter = Net::LDAP::Filter.eq(“objectClass”,“LdapGroup”)
ldap.bind => “dc=company,dc=com”,:filter => ldap_filter) do
puts “Entry == #{entry.inspect}”
As soon as it evalutes ldap.bind I get the PDU error. I’ve tried this in
IRB as well with the same result.

I can open openssl and run the following and it appears the SSL
handshake occurs without a problem.

OpenSSL> s_client -connect ldapserver:11636
Any help is appreciated and I’ll provide anything else I can. I’m
unfortunately stuck with Ruby 1.8.6(can’t upgrade) and accompanying
gems. long story there.

I can also bind to the non SSL port 389 without a problem.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs