编译nginx失败:未定义对'SSL_get0_alpn_selected';和'SSL_CTX_set_alpn_select_cb';

编译nginx失败:未定义对'SSL_get0_alpn_selected';和'SSL_CTX_set_alpn_select_cb';,nginx,makefile,openssl,debian,dpkg,Nginx,Makefile,Openssl,Debian,Dpkg,有关设备的详细信息: 系统:Debian Jessie x86_64服务器(VPS) Web服务器:nginx 1.10.3(最新版本) TLS/SSL库:OpenSSL 1.0.2k(刚刚编译了最新的LTS版本) 问题详情: 问题:从源代码处安装nginx-1.10.3和nginx-1.11.13(已试用) 情况:我已经有一个web服务器启动并运行,但不幸的是,nginx是用旧的OpenSSL 1.0.1t编译的,因此我还不能将HTTP/2与ALPN一起使用。 $ nginx -V ngin

有关设备的详细信息:
系统:Debian Jessie x86_64服务器(VPS)
Web服务器:nginx 1.10.3(最新版本)
TLS/SSL库:OpenSSL 1.0.2k(刚刚编译了最新的LTS版本)

问题详情:
问题:从源代码处安装nginx-1.10.3和nginx-1.11.13(已试用)


情况:我已经有一个web服务器启动并运行,但不幸的是,nginx是用旧的OpenSSL 1.0.1t编译的,因此我还不能将HTTP/2与ALPN一起使用。

$ nginx -V
nginx version: nginx/1.10.3
built by gcc 4.9.2 (Debian 4.9.2-10)
built with OpenSSL 1.0.1t  3 May 2016
TLS SNI support enabled
因此,由于
apt get install——重新安装nginx
不会改变这一点,我认为我必须从源代码
dpkg buildpackage
make
,而这两种方法都会导致相同的错误


问题:每次尝试,结果如下:

objs/src/event/ngx_event_openssl.o: In function `ngx_ssl_check_host':
/build/nginx-local/nginx-src/nginx-1.10.3/src/event/ngx_event_openssl.c:2997: undefined reference to `X509_check_host'
objs/src/http/ngx_http_request.o: In function `ngx_http_ssl_handshake_handler':
/build/nginx-local/nginx-src/nginx-1.10.3/src/http/ngx_http_request.c:780: undefined reference to `SSL_get0_alpn_selected'
objs/src/http/modules/ngx_http_ssl_module.o: In function `ngx_http_ssl_merge_srv_conf':
/build/nginx-local/nginx-src/nginx-1.10.3/src/http/modules/ngx_http_ssl_module.c:653: undefined reference to `SSL_CTX_set_alpn_select_cb'
collect2: error: ld returned 1 exit status
objs/Makefile:302: recipe for target 'objs/nginx' failed
make[1]: *** [objs/nginx] Error 1
make[1]: Leaving directory '/build/nginx-local/nginx-src/nginx-1.10.3'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2

配置:这是我在
生成之前使用的配置:

$ ./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --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-file-aio --with-threads --with-ipv6 --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_ssl_module --with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie'

提前感谢社区的帮助


编辑:

现在我尝试了别的方法。因此,我修改了nginx-1.10.3的源代码,根据修改编辑了变更日志,并在另一台设备(使用OpenSSL 1.0.2j的x64 Debian jessie)上使用
dpkg buildpackage
构建了.deb包,并在我的VPS上进行了更新,但这仍然会导致:

$ nginx -V
nginx version: nginx/1.10.3
built by gcc 4.9.2 (Debian 4.9.2-10)
built with OpenSSL 1.0.1t  3 May 2016
TLS SNI support enabled
新包的更新已成功(我更改了发送的HTTP服务器头以确认更改,并将版本从1.10.3-1重命名为1.10.3-2)

因此,真正的问题是,我现在如何管理使用OpenSSL 1.0.2构建的nginx?我现在对此非常困惑

可以在之间找到修改后的包和源


编辑#2:

即使是在没有openssl或任何服务器的情况下干净(最小)安装VPS也没有任何帮助。我的意思是,当使用原始源代码编译OpenSSL 1.0.2k和nginx 1.12时(不是任何debian软件包或repos上的源代码,因为debian通常都有旧版本),似乎仍然不起作用,并导致nginx使用OpenSSL 1.0.1t编译

我的假设:

libssl和libssl-dev(我对这些包使用了
apt-get
)可能会影响这一点吗

不知何故,nginx仍然使用Debian repos中最“实际”的openSSL版本?(是的,Debian从1.0.1t开始就没有更新他们的openSSL包)


好的,如果我有更多的时间尝试更多的东西,我会更新的。

我通过从源代码构建openssl解决了同样的问题,并将
--使用openssl=../openssl-1.0.2k
添加到nginx的./configure命令中。
可能是与Debian的openssl版本不兼容?

我已经不再尝试了。但是不,当时的“--with openssl=path/to/openssl”也不起作用。这是我自己编译OpenSSL的第一个方法,在配置中使用OpenSSL来修复我的问题,对于其他遇到同样问题的人,我建议尝试一下……在Debian上使用一个更新的OpenSSL版本,考虑使用ReP<代码> DEB。https://packages.sury.org/php {distroName}main
。您将在那里获得更新的php和openssl版本。