Skip to content

Version 0.10.1 gives wrap_with_ssl: undefined method empty? error #175

Closed
@maryheintz

Description

@maryheintz

I'm having an issue with the following script.

#!/Users/mary/Software/rubies/2.1.4/bin/ruby

require 'rubygems'
gem 'net-ldap', '0.10.1'
require 'net/ldap'

ldap = Net::LDAP.new :host => "server.example.com",
  :port => 636,
  :encryption => { :method => :simple_tls },
  :auth => {
    :method=>:simple,
    :username=>"uid=user1,ou=people,dc=server,dc=example,dc=com",
    :password=>"password"
  }

if ldap.bind
 print "OK\n"
else
 print "Not OK\n"
end
yo:test $ ./check_ldap 
/Users/mary/Software/rubies/2.1.4/lib/ruby/gems/2.1.0/gems/net-ldap-0.10.1/lib/net/ldap/connection.rb:51:in `wrap_with_ssl': undefined method `empty?' for nil:NilClass (NoMethodError)
    from /Users/mary/Software/rubies/2.1.4/lib/ruby/gems/2.1.0/gems/net-ldap-0.10.1/lib/net/ldap/connection.rb:94:in `setup_encryption'
    from /Users/mary/Software/rubies/2.1.4/lib/ruby/gems/2.1.0/gems/net-ldap-0.10.1/lib/net/ldap/connection.rb:25:in `initialize'
    from /Users/mary/Software/rubies/2.1.4/lib/ruby/gems/2.1.0/gems/net-ldap-0.10.1/lib/net/ldap.rb:847:in `new'
    from /Users/maryh/Software/rubies/2.1.4/lib/ruby/gems/2.1.0/gems/net-ldap-0.10.1/lib/net/ldap.rb:847:in `block in bind'
    from /Users/maryh/Software/rubies/2.1.4/lib/ruby/gems/2.1.0/gems/net-ldap-0.10.1/lib/net/ldap/instrumentation.rb:19:in `instrument'
    from /Users/maryh/Software/rubies/2.1.4/lib/ruby/gems/2.1.0/gems/net-ldap-0.10.1/lib/net/ldap.rb:841:in `bind'
    from ./check_ldap:16:in `<main>'

If I change the version of net-ldap to 0.9.0, the script works fine.

Our server is running RedHat Enterprise 5.11. Openldap version 2.3.43.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions