winshining / nginx-http-flv-module

A media streaming server based on nginx-rtmp-module. In addtion to the features nginx-rtmp-module provides, HTTP-FLV, GOP cache, VHosts (one IP for multi domain names) and JSON style statistics are supported now.
BSD 2-Clause "Simplified" License
2.71k stars 567 forks source link

error: ‘HMAC_Update’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations] #223

Closed w3yyb closed 2 years ago

w3yyb commented 2 years ago

ubuntu 22.04 nginx 18.0 不能编译

winshining commented 2 years ago

我手头没有 ubuntu 22.04 环境,太新了,暂时无法修改。

I have no ubuntu 22.04 yet, it's a brand new version, it will not be fixed temporarily.

winshining commented 2 years ago

试过了,nginx-1.22.0 可以编译过:

~/workspace/ng/nginx-1.22.0$ ./objs/nginx -V
nginx version: nginx/1.22.0
built by gcc 11.2.0 (Ubuntu 11.2.0-19ubuntu1) 
built with OpenSSL 3.0.2 15 Mar 2022
TLS SNI support enabled
configure arguments: --add-module=../nginx-http-flv-module

nginx-1.20.2 也可以:

~/workspace/ng/nginx-1.20.2$ ./objs/nginx -V
nginx version: nginx/1.20.2
built by gcc 11.2.0 (Ubuntu 11.2.0-19ubuntu1) 
built with OpenSSL 3.0.2 15 Mar 2022
TLS SNI support enabled
configure arguments: --add-module=../nginx-http-flv-module

nginx-1.18.0 本身在 ubuntu 22.04 上就编译不过:

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 ../nginx-http-flv-module -I objs \
    -o objs/src/event/ngx_event_openssl.o \
    src/event/ngx_event_openssl.c
src/event/ngx_event_openssl.c: In function ‘ngx_ssl_load_certificate_key’:
src/event/ngx_event_openssl.c:721:9: error: ‘ENGINE_by_id’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
  721 |         engine = ENGINE_by_id((char *) p);
      |         ^~~~~~
In file included from src/event/ngx_event_openssl.h:22,
                 from src/core/ngx_core.h:84,
                 from src/event/ngx_event_openssl.c:9:

系统版本:

~/workspace$ cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04 (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

所以在 ubuntu 22.04 上,请使用 nginx-1.20.2 以上的版本。

nginx-1.22.0 and nginx-1.20.2 can be compiled along with nginx-http-flv-module on ubuntu 22.04, while nginx-1.18.0 itself can not, so nginx-1.20.2 and later versions are recommended on ubuntu 22.04.