Adldap2 / Adldap2-Laravel

LDAP Authentication & Management for Laravel
MIT License
911 stars 184 forks source link

Can't contact LDAP server when using SSL on production machine. #848

Open TheWhichDoctor opened 4 years ago

TheWhichDoctor commented 4 years ago

Description:

Our intranet system works with SSO middleware and everyone connects perfectly fine while not using SSL to connect. However when I switch the LDAP_PORT and set LDAP_USE_SSL to true it is no longer able to connect, giving the error:

production.ERROR: Can't contact LDAP server {"userId":"<removed>","exception":"[object] (Adldap\\Auth\\BindException(code: -1): Can't contact LDAP server at C:\\inetpub\\vendor\\adldap2\\adldap2\\src\\Auth\\Guard.php:107)

The production website is running on Windows Server 2016 Standard with IIS10. Using the code in a local environment (my win10 PC running XAMPP) it still connects, signs in and the website works perfectly. We called the AD host to see if there was anything they could do and they managed to set up a machine and connect over SSL as well.

I have tried the following solutions but neither have worked: https://github.com/Adldap2/Adldap2-Laravel/issues/318 https://github.com/Adldap2/Adldap2-Laravel/issues/847

Also just wondering if there has been any progress on this enhancement? It would help a lot with debugging problems like this https://github.com/Adldap2/Adldap2-Laravel/issues/813

Moris1 commented 4 years ago

Hi Steve,

I have the same issue as above. When LDAP_USE_SSL=false then all is allright. When LDAP_USE_SSL=true then I get the same issues as described above. Im developing admin web where users can edit ldap users passwords, attributes. So I need ssl connection.

Thanks for letting me know how to solve this.

stevebauman commented 4 years ago

Hi there, please refer to the documentation on the ldaprecord.com as you will need to create an ldap.conf file on your server.

Using the code in a local environment (my win10 PC running XAMPP) it still connects, signs in and the website works perfectly.

This makes me believe there's a possible firewall issue if SSL connectivity is working on your local machine and not on the server itself.

Also just wondering if there has been any progress on this enhancement? It would help a lot with debugging problems like this

I've moved all future improvements and feature development to LdapRecord-Laravel where you will find everything significantly easier to use and debug, along with a ldap:test command, and more features. I've placed a notice about this on the readme:

LdapRecord is the successor to Adldap2 - and comes with a ton of new features. Adldap2-Laravel will continue to be supported with bug fixes, but will not receive new features.

TheWhichDoctor commented 4 years ago

Thanks Steve, The IT guy insists it's not the firewall. I'll try out LdapRecord-Laravel and update once I've found out what's happening.

lovecoding-git commented 2 years ago

@TheWhichDoctor did you solve your issue?