grahamedgecombe / nginx-ct

Certificate Transparency module for nginx.
https://grahamedgecombe.com/projects/nginx-ct
ISC License
176 stars 29 forks source link

Cannot compile nginx due to implicit declarations of functions #19

Closed DamnFinn closed 7 years ago

DamnFinn commented 7 years ago

Used nginx version: 1.11.10 (current mainline version) Used nginx-ct version: current source code Used OpenSSL version: 1.1.0e (2017-Feb-16)

cc -c -fPIC -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 ../nginx-rtmp -I objs -I src/http -I src/http/modules -I src/http/v2 -I src/mail -I src/stream \
        -o objs/addon/nginx-ct/ngx_ssl_ct_module.o \
        ../nginx-ct/ngx_ssl_ct_module.c
../nginx-ct/ngx_ssl_ct_module.c: In function ‘ngx_ssl_ct_merge_srv_conf’:
../nginx-ct/ngx_ssl_ct_module.c:175:5: error: implicit declaration of function ‘SSL_CTX_add_server_custom_ext’ [-Werror=implicit-function-declaration]
     if (SSL_CTX_add_server_custom_ext(ssl_ctx, NGX_SSL_CT_EXT,
     ^
../nginx-ct/ngx_ssl_ct_module.c: In function ‘ngx_ssl_ct_ext_cb’:
../nginx-ct/ngx_ssl_ct_module.c:192:5: error: implicit declaration of function ‘SSL_set_current_cert’ [-Werror=implicit-function-declaration]
     int result = SSL_set_current_cert(s, SSL_CERT_SET_SERVER);
     ^
../nginx-ct/ngx_ssl_ct_module.c:192:42: error: ‘SSL_CERT_SET_SERVER’ undeclared (first use in this function)
     int result = SSL_set_current_cert(s, SSL_CERT_SET_SERVER);
                                          ^
../nginx-ct/ngx_ssl_ct_module.c:192:42: note: each undeclared identifier is reported only once for each function it appears in
cc1: all warnings being treated as errors
objs/Makefile:2077: recipe for target 'objs/addon/nginx-ct/ngx_ssl_ct_module.o' failed
make[1]: *** [objs/addon/nginx-ct/ngx_ssl_ct_module.o] Error 1

How can I solve this?

grahamedgecombe commented 7 years ago

Can you provide the full ./configure and make invocations you used to build nginx?

What distro are you using, and are you using the distro's OpenSSL package?

DamnFinn commented 7 years ago

I'm using Debian 8.7 (jessie, stable). For OpenSSL I used the testing branch because on stable there is just OpenSSL 1.0.1t. With OpenSSL 1.0.2k (via jessie-backports) the make succeeds.

./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module --with-mail --with-mail_ssl_module --with-file-aio --with-http_v2_module --add-dynamic-module=../nginx-rtmp --add-dynamic-module=../nginx-ct

make
grahamedgecombe commented 7 years ago

I'm using Debian 8.7 (jessie, stable). For OpenSSL I used the testing branch

Mixing stable/testing isn't officially supported by Debian btw: https://wiki.debian.org/DontBreakDebian#Don.27t_make_a_FrankenDebian

grahamedgecombe commented 7 years ago

I just tried installing libssl-dev from stretch (added stretch lines to sources.list then ran apt install -t stretch libssl-dev) in a clean jessie chroot to mirror your setup and it compiled fine. Does that mirror your setup?

Admittedly I didn't try with the full set of ./configure flags - I just tried --with-http_ssl_module --add-module=../nginx-ct and --with-http_ssl_module --add-dynamic-module=../nginx-ct. Will try to investigate further when I find time.

DamnFinn commented 7 years ago

I installed OpenSSL via: apt install -t testing openssl or apt install -t stretch openssl. See openssl version: Currently 1.1.0e-1.

For me it okay to use 1.0.2k from jessie-backports.

grahamedgecombe commented 7 years ago

Okay, if that works for you I'll close this issue and chalk it up to some mixing Debian stable/testing weirdness. If someone else comes across this I can re-open it and investigate again.