From 3efac5658ff134ef6cda4f134e8fc32a1cf3927b Mon Sep 17 00:00:00 2001 From: Soner Tari Date: Sun, 3 Apr 2022 17:40:36 +0300 Subject: [PATCH] Fix build errors with OpenSSL 3.0.x, but not deprecation warnings This patch fixes errors only, so that build succeeds, but deprecation warnings remain. It seems we need considerable changes to replace those deprecated functions in the warnings. --- Mk/main.mk | 4 ++++ src/protossl.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/Mk/main.mk b/Mk/main.mk index c229337..5f144fe 100644 --- a/Mk/main.mk +++ b/Mk/main.mk @@ -378,7 +378,11 @@ endif ifdef OPENSSL_FOUND PKG_CPPFLAGS+= -I$(OPENSSL_FOUND)/include +ifneq ($(findstring openssl-3.,$(OPENSSL_FOUND)),openssl-3.) PKG_LDFLAGS+= -L$(OPENSSL_FOUND)/lib +else +PKG_LDFLAGS+= -L$(OPENSSL_FOUND)/lib64 +endif PKG_LIBS+= -lssl -lcrypto -lz endif ifdef LIBEVENT_FOUND diff --git a/src/protossl.c b/src/protossl.c index 37bd5ce..2d8a4c6 100644 --- a/src/protossl.c +++ b/src/protossl.c @@ -44,6 +44,11 @@ static unsigned long ssl_session_context = 0x31415926; #endif /* USE_SSL_SESSION_ID_CONTEXT */ +#if OPENSSL_VERSION_NUMBER >= 0x30000000L +#define ERR_GET_FUNC(x) 0 +#define ERR_func_error_string(x) "" +#endif + void protossl_log_ssl_error(struct bufferevent *bev, pxy_conn_ctx_t *ctx) {