Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fails with Nginx 1.23 #180

Open
Kontr3X opened this issue Aug 10, 2022 · 4 comments
Open

Compilation fails with Nginx 1.23 #180

Kontr3X opened this issue Aug 10, 2022 · 4 comments

Comments

@Kontr3X
Copy link

Kontr3X commented Aug 10, 2022

In file included from src/core/ngx_core.h:60,
                 from /root/sources/nginx_tcp_proxy_module/ngx_tcp_session.c:3:
/root/sources/nginx_tcp_proxy_module/ngx_tcp_session.c: In function ‘ngx_tcp_send’:
/root/sources/nginx_tcp_proxy_module/ngx_tcp_session.c:351:20: error: ‘NGX_LOG_DEBUG_TCP’ undeclared (first use in this function); did you mean ‘NGX_LOG_DEBUG_HTTP’?
  351 |     ngx_log_debug1(NGX_LOG_DEBUG_TCP, wev->log, 0, "nginx tcp send:%d", n);
      |                    ^~~~~~~~~~~~~~~~~
src/core/ngx_log.h:92:28: note: in definition of macro ‘ngx_log_debug’
   92 |     if ((log)->log_level & level)                                             \
      |                            ^~~~~
/root/sources/nginx_tcp_proxy_module/ngx_tcp_session.c:351:5: note: in expansion of macro ‘ngx_log_debug1’
  351 |     ngx_log_debug1(NGX_LOG_DEBUG_TCP, wev->log, 0, "nginx tcp send:%d", n);
      |     ^~~~~~~~~~~~~~
/root/sources/nginx_tcp_proxy_module/ngx_tcp_session.c:351:20: note: each undeclared identifier is reported only once for each function it appears in
  351 |     ngx_log_debug1(NGX_LOG_DEBUG_TCP, wev->log, 0, "nginx tcp send:%d", n);
      |                    ^~~~~~~~~~~~~~~~~
src/core/ngx_log.h:92:28: note: in definition of macro ‘ngx_log_debug’
   92 |     if ((log)->log_level & level)                                             \
      |                            ^~~~~
/root/sources/nginx_tcp_proxy_module/ngx_tcp_session.c:351:5: note: in expansion of macro ‘ngx_log_debug1’
  351 |     ngx_log_debug1(NGX_LOG_DEBUG_TCP, wev->log, 0, "nginx tcp send:%d", n);
      |     ^~~~~~~~~~~~~~
/root/sources/nginx_tcp_proxy_module/ngx_tcp_session.c: In function ‘ngx_tcp_finalize_session’:
/root/sources/nginx_tcp_proxy_module/ngx_tcp_session.c:410:20: error: ‘NGX_LOG_DEBUG_TCP’ undeclared (first use in this function); did you mean ‘NGX_LOG_DEBUG_HTTP’?
  410 |     ngx_log_debug1(NGX_LOG_DEBUG_TCP, c->log, 0,
      |                    ^~~~~~~~~~~~~~~~~
src/core/ngx_log.h:92:28: note: in definition of macro ‘ngx_log_debug’
   92 |     if ((log)->log_level & level)                                             \
      |                            ^~~~~
/root/sources/nginx_tcp_proxy_module/ngx_tcp_session.c:410:5: note: in expansion of macro ‘ngx_log_debug1’
  410 |     ngx_log_debug1(NGX_LOG_DEBUG_TCP, c->log, 0,
      |     ^~~~~~~~~~~~~~
/root/sources/nginx_tcp_proxy_module/ngx_tcp_session.c: In function ‘ngx_tcp_close_connection’:
/root/sources/nginx_tcp_proxy_module/ngx_tcp_session.c:431:20: error: ‘NGX_LOG_DEBUG_TCP’ undeclared (first use in this function); did you mean ‘NGX_LOG_DEBUG_HTTP’?
  431 |     ngx_log_debug1(NGX_LOG_DEBUG_TCP, c->log, 0,
      |                    ^~~~~~~~~~~~~~~~~
src/core/ngx_log.h:92:28: note: in definition of macro ‘ngx_log_debug’
   92 |     if ((log)->log_level & level)                                             \
      |                            ^~~~~
/root/sources/nginx_tcp_proxy_module/ngx_tcp_session.c:431:5: note: in expansion of macro ‘ngx_log_debug1’
  431 |     ngx_log_debug1(NGX_LOG_DEBUG_TCP, c->log, 0,
      |     ^~~~~~~~~~~~~~
/root/sources/nginx_tcp_proxy_module/ngx_tcp_session.c: In function ‘ngx_tcp_cleanup_add’:
/root/sources/nginx_tcp_proxy_module/ngx_tcp_session.c:519:20: error: ‘NGX_LOG_DEBUG_TCP’ undeclared (first use in this function); did you mean ‘NGX_LOG_DEBUG_HTTP’?
  519 |     ngx_log_debug1(NGX_LOG_DEBUG_TCP, s->connection->log, 0,
      |                    ^~~~~~~~~~~~~~~~~
src/core/ngx_log.h:92:28: note: in definition of macro ‘ngx_log_debug’
   92 |     if ((log)->log_level & level)                                             \
      |                            ^~~~~
/root/sources/nginx_tcp_proxy_module/ngx_tcp_session.c:519:5: note: in expansion of macro ‘ngx_log_debug1’
  519 |     ngx_log_debug1(NGX_LOG_DEBUG_TCP, s->connection->log, 0,
      |     ^~~~~~~~~~~~~~
make[1]: *** [objs/Makefile:1690: objs/addon/nginx_tcp_proxy_module/ngx_tcp_session.o] Error 1
make[1]: Leaving directory '/root/sources/nginx-1.23.1'
make: *** [Makefile:10: build] Error 2

NGINX VERSION: nginx-1.23.1
Debian GNU/Linux 11 (bullseye)

@Kontr3X
Copy link
Author

Kontr3X commented Aug 11, 2022

.. it fails also with the current stable nginx version 1.22.0..

@yaoweibin
Copy link
Owner

yaoweibin commented Aug 12, 2022 via email

@yaoweibin
Copy link
Owner

It looks like it's broken since nginx-1.20.2, they change a lot of SSL functions. Let me see how to solve it.

@dereliahmet1
Copy link

1.20.1 also gives the error related with SSL functions.

src/event/ngx_event_openssl.c:729:9: error: ‘ENGINE_by_id’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
  729 |         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:
/usr/include/openssl/engine.h:336:31: note: declared here
  336 | OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_by_id(const char *id);
      |                               ^~~~~~~~~~~~
src/event/ngx_event_openssl.c:738:9: error: ‘ENGINE_load_private_key’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
  738 |         pkey = ENGINE_load_private_key(engine, (char *) last, 0, 0);
      |         ^~~~
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:
/usr/include/openssl/engine.h:638:11: note: declared here
  638 | EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
      |           ^~~~~~~~~~~~~~~~~~~~~~~
src/event/ngx_event_openssl.c:742:13: error: ‘ENGINE_free’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
  742 |             ENGINE_free(engine);
      |             ^~~~~~~~~~~
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:
/usr/include/openssl/engine.h:493:27: note: declared here
493 | OSSL_DEPRECATEDIN_3_0 int ENGINE_free(ENGINE *e);
      |                           ^~~~~~~~~~~
src/event/ngx_event_openssl.c:746:9: error: ‘ENGINE_free’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
  746 |         ENGINE_free(engine);
      |         ^~~~~~~~~~~
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:
/usr/include/openssl/engine.h:493:27: note: declared here
  493 | OSSL_DEPRECATEDIN_3_0 int ENGINE_free(ENGINE *e);
      |                           ^~~~~~~~~~~
src/event/ngx_event_openssl.c: In function ‘ngx_ssl_dhparam’:
src/event/ngx_event_openssl.c:1371:5: error: ‘PEM_read_bio_DHparams’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
 1371 |     dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
      |     ^~
In file included from /usr/include/openssl/ssl.h:36,
                 from src/event/ngx_event_openssl.h:15,
                 from src/core/ngx_core.h:84,
                 from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/pem.h:469:1: note: declared here
  469 | DECLARE_PEM_rw_attr(OSSL_DEPRECATEDIN_3_0, DHparams, DH)
      | ^~~~~~~~~~~~~~~~~~~
src/event/ngx_event_openssl.c:1381:5: error: ‘DH_free’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
 1381 |     DH_free(dh);
      |     ^~~~~~~
In file included from /usr/include/openssl/dsa.h:51,
                 from /usr/include/openssl/x509.h:37,
                 from /usr/include/openssl/ssl.h:31,
                 from src/event/ngx_event_openssl.h:15,
                 from src/core/ngx_core.h:84,
                 from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/dh.h:204:28: note: declared here
  204 | OSSL_DEPRECATEDIN_3_0 void DH_free(DH *dh);
      |                            ^~~~~~~
src/event/ngx_event_openssl.c: In function ‘ngx_ssl_error’:
src/event/ngx_event_openssl.c:3232:13: error: ‘ERR_peek_error_line_data’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
 3232 |             n = ERR_peek_error_line_data(NULL, NULL, &data, &flags);
      |             ^
In file included from src/event/ngx_event_openssl.h:16,
                 from src/core/ngx_core.h:84,
                 from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/err.h:425:15: note: declared here
  425 | unsigned long ERR_peek_error_line_data(const char **file, int *line,
      |               ^~~~~~~~~~~~~~~~~~~~~~~~
src/event/ngx_event_openssl.c: In function ‘ngx_ssl_session_ticket_key_callback’:
src/event/ngx_event_openssl.c:4140:9: error: ‘HMAC_Init_ex’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
 4140 |         if (HMAC_Init_ex(hctx, key[0].hmac_key, size, digest, NULL) != 1) {
      |         ^~
In file included from /usr/include/openssl/ssl.h:37,
                 from src/event/ngx_event_openssl.h:15,
                 from src/core/ngx_core.h:84,
                 from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/hmac.h:43:27: note: declared here
   43 | OSSL_DEPRECATEDIN_3_0 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
      |                           ^~~~~~~~~~~~
src/event/ngx_event_openssl.c:4183:9: error: ‘HMAC_Init_ex’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
 4183 |         if (HMAC_Init_ex(hctx, key[i].hmac_key, size, digest, NULL) != 1) {
      |         ^~
In file included from /usr/include/openssl/ssl.h:37,
                 from src/event/ngx_event_openssl.h:15,
                 from src/core/ngx_core.h:84,
                 from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/hmac.h:43:27: note: declared here
   43 | OSSL_DEPRECATEDIN_3_0 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
      |                           ^~~~~~~~~~~~
src/event/ngx_event_openssl.c: In function ‘ngx_openssl_engine’:
src/event/ngx_event_openssl.c:5336:5: error: ‘ENGINE_by_id’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
 5336 |     engine = ENGINE_by_id((char *) value[1].data);
      |     ^~~~~~
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:
/usr/include/openssl/engine.h:336:31: note: declared here
  336 | OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_by_id(const char *id);
      |                               ^~~~~~~~~~~~
src/event/ngx_event_openssl.c:5344:5: error: ‘ENGINE_set_default’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
 5344 |     if (ENGINE_set_default(engine, ENGINE_METHOD_ALL) == 0) {
      |     ^~
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:
/usr/include/openssl/engine.h:708:27: note: declared here
  708 | OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default(ENGINE *e, unsigned int flags);
      |                           ^~~~~~~~~~~~~~~~~~
src/event/ngx_event_openssl.c:5349:9: error: ‘ENGINE_free’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
 5349 |         ENGINE_free(engine);
      |         ^~~~~~~~~~~
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:
/usr/include/openssl/engine.h:493:27: note: declared here
  493 | OSSL_DEPRECATEDIN_3_0 int ENGINE_free(ENGINE *e);
      |                           ^~~~~~~~~~~
src/event/ngx_event_openssl.c:5354:5: error: ‘ENGINE_free’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
 5354 |     ENGINE_free(engine);
      |     ^~~~~~~~~~~
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:
/usr/include/openssl/engine.h:493:27: note: declared here
  493 | OSSL_DEPRECATEDIN_3_0 int ENGINE_free(ENGINE *e);
      |                           ^~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [objs/Makefile:875: objs/src/event/ngx_event_openssl.o] Error 1
make[1]: Leaving directory '/root/build/nginx-1.20.1'
make: *** [Makefile:10: build] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants