mardi 23 février 2021

ruby LDAPS connection reset by peer - SSL_connect

I am using WSL 2 with Ubuntu 20.04 and try to connect to the host which is implemented with LDAPS, When trying to connect with LDAP with port 389 everything works fine. But when tried to connect with LDAPS using the port 636, I am ending up getting "Connection reset by peerl - SSL_connect" error.

I am using the below configuration

    @host     = "hostname.example.com"
    @port     = "636"
    @user     = "admin"
    @password = "Password1!"

    tls_options = {
      verify_mode: OpenSSL::SSL::VERIFY_NONE
    }
    @msg = nil
    @connected = false
    @ldap = Net::LDAP.new host: @host, port: @port, base: @base,
    auth: { method: :simple, username: @user, password: @password },
    :encryption => {
      :method => :simple_tls,
      :tls_options => tls_options
    }
    @connected = true if @ldap.bind

I have even tried with start_tls as the encryption methond. Still not working. Later found out that the exact code works with the other computers. I would like to know what will be the bottleneck, why the connection is not working on my machine.?

Should there be any configuration that I need to update on the WSL2 on Ubuntu 20.04?

I am unable to find the difference.

any pointers would be highly helpful.

Thanks

Aucun commentaire:

Enregistrer un commentaire