DirectoryTree / LdapRecord

A fully-featured LDAP framework.
https://ldaprecord.com
MIT License
500 stars 44 forks source link

[Feature] Disable mandatory TLS connection for localhost #700

Closed gaspard-v closed 5 months ago

gaspard-v commented 5 months ago

Hello,

Thank you for LdapRecord, it's a great tool and I use it a lot :)

I try to change user password, my PHP server is on the same computer as my OpenLDAP, so my LDAP_HOST is localhost. When I try to change user password, I got an error: "You must be connected to your LDAP server with TLS or SSL to perform this operation."

There's no point to use SSL/TLS on a "localhost" connection.

I'd suggest to skip this SSL/TLS verification if ldap connection is localhost, 127.0.0.1/8 or ::1

Thank

stevebauman commented 5 months ago

Hi @gaspard-v,

I've just released an update with a new configuration option that disables this check:

$config = [
    // ...
    'allow_insecure_password_changes' => true,
];

Please run composer update, set this option in your LDAP connection configuration, and you're all set! 👍

gaspard-v commented 5 months ago

thank you!