# Not verifying SSL hostname of LDAPS server 'host.domain:636'

**URL:** <https://www.ruby-forum.com/t/not-verifying-ssl-hostname-of-ldaps-server-host-domain-636/260424>\
**Category:** Development\
**Created:** [October 26, 2020, 10:59am UTC](https://www.ruby-forum.com/t/not-verifying-ssl-hostname-of-ldaps-server-host-domain-636/260424 "2020-10-26T10:59:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lulubear](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lulubear](https://www.ruby-forum.com/u/lulubear)\
**Post date:** [October 26, 2020, 10:59am UTC](https://www.ruby-forum.com/t/not-verifying-ssl-hostname-of-ldaps-server-host-domain-636/260424/1 "2020-10-26T10:59:36Z")

</div>

Hi,

I know this is all over the internet but I wasn’t able to get the data that I need after doing lots of trial and errors from the solutions that I’ve found online. I need to have it as anonymous bind.

Here is my code. It’s in rubocop format. I cannot get any data of `computer01` in `allomputers` OU using the `ldap.search`. Anything that I’ve been missing?

```
#!/bin/ruby

require 'net/ldap'

hostname = 'computer01' 
domain = 'host.domain'
treebase = 'OU=allcomputers,DC=host,DC=domain'

ldap = Net::LDAP.new host: domain,
                     port: 636,
                     base: treebase,
                     encryption: { method: :simple_tls, tls_options: { verify_mode: OpenSSL::SSL::VERIFY_NONE } } ,
		     force_no_page: true

filter = Net::LDAP::Filter.eq('CN', hostname)

ldap.search(base: treebase, filter: filter) do |entry|
	p entry.dn
	# not verifying SSL hostname of LDAPS server 'allcomputer.domain:636'
end 

```

Thank you.

---

<div class="post-metadata">

**Author:** ![specious](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@specious](https://www.ruby-forum.com/u/specious)\
**Post date:** [October 27, 2020, 8:27am UTC](https://www.ruby-forum.com/t/not-verifying-ssl-hostname-of-ldaps-server-host-domain-636/260424/2 "2020-10-27T08:27:31Z")

</div>

What errors do you get?

---

<div class="post-metadata">

**Author:** ![lulubear](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lulubear](https://www.ruby-forum.com/u/lulubear)\
**Post date:** [October 27, 2020, 10:15am UTC](https://www.ruby-forum.com/t/not-verifying-ssl-hostname-of-ldaps-server-host-domain-636/260424/3 "2020-10-27T10:15:08Z")

</div>

I cannot get data of the `computer01` and get only the `not verifying SSL hostname of LDAPS server 'allcomputer.domain:636'`
