kvspb / nginx-auth-ldap

LDAP authentication module for nginx
BSD 2-Clause "Simplified" License
739 stars 253 forks source link

LDAPS is not supported #197

Open likered opened 6 years ago

likered commented 6 years ago
nginx: [emerg] http_auth_ldap: Protocol "ldaps://" is not supported. in /etc/nginx/nginx.conf:81
nginx: configuration file /etc/nginx/nginx.conf test failed

I built my nginx from source using the following:

./configure --user=nginx --group=nginx --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx 
--conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid 
--lock-path=/var/run/nginx.lock --error-log-path=/var/log/nginx/error.log 
--http-log-path=/var/log/nginx/access.log --without-http_gzip_module 
--with-http_stub_status_module --with-pcre --with-file-aio --with-http_realip_module 
--add-module=/home/ubuntu/nginx-auth-ldap --with-ipv6 --with-debug

(not sure if it means much, but no gzip)

ldap_server block:

##
# LDAP configurations
##
auth_ldap_cache_enabled on;
auth_ldap_cache_expiration_time 1000;
auth_ldap_cache_size 1000;

ldap_server test {
    url "ldaps://ldaps.company.com:636/OU=Users,DC=company,DC=com?sAMAccountName?sub";
    binddn "CN=asdf,OU=Users,DC=company,DC=com";
    binddn_passwd "password";
}

server block:

location /dev/admin {
    auth_ldap "Forbidden";
    auth_ldap_servers test;
}

What seems to be the issue? I see that ldaps is supported from the README.md, but for some reason mine is not cooperating.

nginx version: 1.9.9

Thank you!

likered commented 6 years ago

Looks like I may have had an older version of NGINX. I have just tried 1.12.2 and it worked flawlessly.

But still wondering why it would do that for 1.9.9 though.

warmans commented 6 years ago

I think you need --with-http_ssl_module in your configure or ldaps will never work. I'm not sure why using a new version would change anything... could be a change to how configure works I guess.