ruby-ldap
ruby-ldap copied to clipboard
expose ldap error reason somehow
Hi there. This is a complex topic, but right now what's needed is more info from underlying layer.
Take for ex.,
> begin; LDAP::SSLConn.new(host, port, true) ; rescue => e ; e ; end
=> #<LDAP::ResultError: Connect error>
No way of knowing what caused it. You can't access errno because you've got no LDAP::Conn object returned. Chicken and egg situation, basically.
In this particular case it was SSL verification that failed (hostname vs cert CN mismatch). There could be SASL failure later on, which I guess isn't logged properly either.
Thanks.