nginx-auth-ldap icon indicating copy to clipboard operation
nginx-auth-ldap copied to clipboard

Nginx won't compile with newest commit

Open JannickH91 opened this issue 9 years ago • 9 comments

I know you sort of wrote this, but after the newest commit nginx wouldn't compile for me, because i lacked the specified openssl version. So it should probably be listed as a requirement at this point, unless there is some way to fix it or skip the check for the new features.

JannickH91 avatar Feb 11 '16 14:02 JannickH91

I'm getting this as well.

OSX 10.11:

/Applications/Xcode.app/Contents/Developer/usr/bin/make -f objs/Makefile
cc -c -pipe  -O -Wall -Wextra -Wpointer-arith -Wconditional-uninitialized -Wno-unused-parameter -Wno-deprecated-declarations -Werror -g   -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/local/include -I objs -I src/http -I src/http/modules \
        -o objs/addon/nginx-auth-ldap/ngx_http_auth_ldap_module.o \
        nginx-auth-ldap/ngx_http_auth_ldap_module.c
nginx-auth-ldap/ngx_http_auth_ldap_module.c:38:32: error: unknown warning group '-Wcpp', ignored [-Werror,-Wunknown-pragmas]
#pragma GCC diagnostic warning "-Wcpp"
                               ^
nginx-auth-ldap/ngx_http_auth_ldap_module.c:395:8: error: "http_auth_ldap: Compiling with OpenSSL < 1.0.2, certificate verification will be unavailable. OPENSSL_VERSION_NUMBER == " XSTR(OPENSSL_VERSION_NUMBER) [-Werror,-W#warnings]
      #warning "http_auth_ldap: Compiling with OpenSSL < 1.0.2, certificate verification will be unavailable. OPENSSL_VERSION_NUMBER == " XSTR(OPENSSL_VERSION_NUMBER)
       ^
2 errors generated.
make[1]: *** [objs/addon/nginx-auth-ldap/ngx_http_auth_ldap_module.o] Error 1
make: *** [build] Error 2

Nginx was built with openssl 1.0.2f and compiles cleanly:

# ./nginx -V
nginx version: nginx/1.9.11
built by clang 7.0.2 (clang-700.1.81)
configure arguments: --with-openssl=/usr/local/Cellar/openssl/1.0.2f/

To an untrained eye, it looks like the check on line 392 (introduced in 2e3e8a9e147a0446b5097976695fa6cc5cb6f172) is using a greater than when it should be using a less than:

#if OPENSSL_VERSION_NUMBER >= 0x10002000

Karunamon avatar Feb 11 '16 18:02 Karunamon

Im also having problems with this

make -f objs/Makefile
make[1]: Entering directory '/root/nginx'
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g   -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \
        -o objs/addon/nginx-auth-ldap/ngx_http_auth_ldap_module.o \
        src/http/modules/nginx-auth-ldap//ngx_http_auth_ldap_module.c
cc1: warnings being treated as errors
src/http/modules/nginx-auth-ldap//ngx_http_auth_ldap_module.c:38: error: unknown option after ‘#pragma GCC diagnostic’ kind
src/http/modules/nginx-auth-ldap//ngx_http_auth_ldap_module.c:395:8: error: #warning "http_auth_ldap: Compiling with OpenSSL < 1.0.2, certificate verification will be unavailable. OPENSSL_VERSION_NUMBER == " XSTR(OPENSSL_VERSION_NUMBER)
make[1]: *** [objs/addon/nginx-auth-ldap/ngx_http_auth_ldap_module.o] Error 1
make[1]: Leaving directory '/root/nginx'
make: *** [build] Error 2

popoyorc avatar Mar 02 '16 07:03 popoyorc

Sorry man, i never managed to fix that issue. I just rolled back to a git-version that worked for me (the one before the ssl update).

2016-03-02 8:26 GMT+01:00 Eric Adordionicio [email protected]:

Im also having problems with this

make -f objs/Makefile make[1]: Entering directory '/root/nginx' cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules
-o objs/addon/nginx-auth-ldap/ngx_http_auth_ldap_module.o
src/http/modules/nginx-auth-ldap//ngx_http_auth_ldap_module.c cc1: warnings being treated as errors src/http/modules/nginx-auth-ldap//ngx_http_auth_ldap_module.c:38: error: unknown option after ‘#pragma GCC diagnostic’ kind src/http/modules/nginx-auth-ldap//ngx_http_auth_ldap_module.c:395:8: error: #warning "http_auth_ldap: Compiling with OpenSSL < 1.0.2, certificate verification will be unavailable. OPENSSL_VERSION_NUMBER == " XSTR(OPENSSL_VERSION_NUMBER) make[1]: *** [objs/addon/nginx-auth-ldap/ngx_http_auth_ldap_module.o] Error 1 make[1]: Leaving directory '/root/nginx' make: *** [build] Error 2

— Reply to this email directly or view it on GitHub https://github.com/kvspb/nginx-auth-ldap/issues/123#issuecomment-191108845 .

JannickH91 avatar Mar 02 '16 12:03 JannickH91

Alright thanks @JannickH91 , just so everyone knows I'm gonna put that commit here. [256cafe]

popoyorc avatar Mar 03 '16 01:03 popoyorc

/usr/local/src/nginx-auth-ldap/ngx_http_auth_ldap_module.c:38: error: unknown option after ‘#pragma GCC diagnostic’ kind /usr/local/src/nginx-auth-ldap/ngx_http_auth_ldap_module.c:395:8: error: #warning "http_auth_ldap: Compiling with OpenSSL < 1.0.2, certificate verification will be unavailable. OPENSSL_VERSION_NUMBER == " XSTR(OPENSSL_VERSION_NUMBER) make[1]: *** [objs/addon/nginx-auth-ldap/ngx_http_auth_ldap_module.o] Error 1 make[1]: Leaving directory `/usr/local/src/nginx-1.6.2' make: *** [build] Error 2

I also have the same problem, how to do?

wanggaolin avatar May 27 '16 05:05 wanggaolin

Hi guys,

PR #139 should fix this problem.

You can actually compile with an older SSL version -- it just won't be secure and throws a warning to tell you that.

The basic problem here is that nginx forces compilation with -Werror, which is a bad idea to begin with. I tried to fix this by including a GCC pragma telling the compiler not to escalate this warning which, alas, gets ignored by clang -- which is the default compiler on OS X.

victorhahncastell avatar May 27 '16 13:05 victorhahncastell

thanks , Looks like I have to upgrade OpenSSL!

wanggaolin avatar May 30 '16 01:05 wanggaolin

I use nginx1.8 based on CentOS6.5,Also appear this mistake.Unable to resolve!

billy98 avatar Jun 29 '16 01:06 billy98

@billy98, have you tried pulling PR #139? This should fix it. However, if you need secure communication with the LDAP server you need to upgrade your OpenSSL version.

victorhahncastell avatar Jun 29 '16 11:06 victorhahncastell