From e17de8454a65d2b9ba432856971405dfcf1e7522 Mon Sep 17 00:00:00 2001
From: Soner Tari <sonertari@gmail.com>
Date: Fri, 4 Feb 2022 19:46:58 +0300
Subject: [PATCH] Fix build errors with OpenSSL 3.0.x, but not deprecation
warnings, issue #290
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.
---
GNUmakefile | 4 ++++
pxyconn.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/GNUmakefile b/GNUmakefile
index cc7197ea..5f927514 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -350,7 +350,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/pxyconn.c b/pxyconn.c
index e69de201..09a8b806 100644
--- a/pxyconn.c
+++ b/pxyconn.c
@@ -72,6 +72,10 @@ bufferevent_openssl_set_allow_dirty_shutdown(UNUSED struct bufferevent *bev,
}
#endif /* LIBEVENT_VERSION_NUMBER < 0x02010000 */
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+#define ERR_GET_FUNC(x) 0
+#define ERR_func_error_string(x) ""
+#endif
/*
* Maximum size of data to buffer per connection direction before