rails devsie_ldp 如何忽略证书验证?

rails devsie_ldp how to ignore certificate verification?

我正在使用 devise_ldap_authenticatable 模块来进行简单的 ldap 身份验证。 但是,如果我尝试在 ssl(689 端口)上进行身份验证,则会出现此错误:

Net::LDAP::Error (hostname "x.x.x.x" does not match the server certificate):

所以,我需要忽略这个验证。 我试过 google,但没有结果 :( 我该怎么做?

根据 devise_ldap_authenticatable documentation

If you're using a test LDAP server running a self-signed SSL certificate, make sure the appropriate root certificate is installed on your system. Alternately, you may temporarily disable certificate checking for SSL by modifying your system LDAP configuration (e.g., /etc/openldap/ldap.conf or /etc/ldap/ldap.conf) to read TLS_REQCERT never.