From 463046ea6f27af59035e15135191ef87d3c9ec29 Mon Sep 17 00:00:00 2001
From: Michael Paquier <michael@paquier.xyz>
Date: Thu, 5 Dec 2019 16:41:59 +0900
Subject: [PATCH 1/3] Remove configure checks for SSL_get_current_compression
 in OpenSSL

This function is supported down to OpenSSL 0.9.8, which is the oldest
version supported on HEAD.
---
 configure                     | 2 +-
 configure.in                  | 2 +-
 src/include/pg_config.h.in    | 3 ---
 src/include/pg_config.h.win32 | 3 ---
 src/include/port.h            | 4 ----
 5 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/configure b/configure
index 1d88983b34..56c4aaa95b 100755
--- a/configure
+++ b/configure
@@ -12094,7 +12094,7 @@ else
 fi
 
   fi
-  for ac_func in SSL_clear_options SSL_get_current_compression X509_get_signature_nid
+  for ac_func in SSL_clear_options X509_get_signature_nid
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff --git a/configure.in b/configure.in
index a2cb20b5e3..9fd9c390e6 100644
--- a/configure.in
+++ b/configure.in
@@ -1186,7 +1186,7 @@ if test "$with_openssl" = yes ; then
      AC_SEARCH_LIBS(CRYPTO_new_ex_data, [eay32 crypto], [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])
      AC_SEARCH_LIBS(SSL_new, [ssleay32 ssl], [], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])
   fi
-  AC_CHECK_FUNCS([SSL_clear_options SSL_get_current_compression X509_get_signature_nid])
+  AC_CHECK_FUNCS([SSL_clear_options X509_get_signature_nid])
   # Functions introduced in OpenSSL 1.1.0. We used to check for
   # OPENSSL_VERSION_NUMBER, but that didn't work with 1.1.0, because LibreSSL
   # defines OPENSSL_VERSION_NUMBER to claim version 2.0.0, even though it
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index c208dcdfc7..0d77f2aafd 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -515,9 +515,6 @@
 /* Define to 1 if you have the `SSL_clear_options' function. */
 #undef HAVE_SSL_CLEAR_OPTIONS
 
-/* Define to 1 if you have the `SSL_get_current_compression' function. */
-#undef HAVE_SSL_GET_CURRENT_COMPRESSION
-
 /* Define to 1 if stdbool.h conforms to C99. */
 #undef HAVE_STDBOOL_H
 
diff --git a/src/include/pg_config.h.win32 b/src/include/pg_config.h.win32
index 6c98ef4916..467fb89ee6 100644
--- a/src/include/pg_config.h.win32
+++ b/src/include/pg_config.h.win32
@@ -373,9 +373,6 @@
 /* Define to 1 if you have the `SSL_clear_options' function. */
 #define HAVE_SSL_CLEAR_OPTIONS 1
 
-/* Define to 1 if you have the `SSL_get_current_compression' function. */
-#define HAVE_SSL_GET_CURRENT_COMPRESSION 1
-
 /* Define to 1 if stdbool.h conforms to C99. */
 #define HAVE_STDBOOL_H 1
 
diff --git a/src/include/port.h b/src/include/port.h
index 10dcb5f0a6..bfd2e2759f 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -446,10 +446,6 @@ extern void unsetenv(const char *name);
 extern void srandom(unsigned int seed);
 #endif
 
-#ifndef HAVE_SSL_GET_CURRENT_COMPRESSION
-#define SSL_get_current_compression(x) 0
-#endif
-
 #ifndef HAVE_DLOPEN
 extern void *dlopen(const char *file, int mode);
 extern void *dlsym(void *handle, const char *symbol);
-- 
2.24.0

