diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c index 39b1a66236..1d11e40725 100644 --- a/src/backend/libpq/be-secure-openssl.c +++ b/src/backend/libpq/be-secure-openssl.c @@ -27,6 +27,15 @@ #include #include +#include +#include +#include +#ifndef OPENSSL_NO_ECDH +#include +#endif +#include + +#include "common/openssl.h" #include "common/string.h" #include "libpq/libpq.h" #include "miscadmin.h" @@ -37,21 +46,6 @@ #include "utils/builtins.h" #include "utils/memutils.h" -/* - * These SSL-related #includes must come after all system-provided headers. - * This ensures that OpenSSL can take care of conflicts with Windows' - * by #undef'ing the conflicting macros. (We don't directly - * include , but some other Windows headers do.) - */ -#include "common/openssl.h" -#include -#include -#ifndef OPENSSL_NO_ECDH -#include -#endif -#include - - /* default init hook can be overridden by a shared library */ static void default_openssl_tls_init(SSL_CTX *context, bool isServerStart); openssl_tls_init_hook_typ openssl_tls_init_hook = default_openssl_tls_init; diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c index bf9dfbf918..a938a746a4 100644 --- a/src/interfaces/libpq/fe-secure-openssl.c +++ b/src/interfaces/libpq/fe-secure-openssl.c @@ -30,6 +30,7 @@ #include "fe-auth.h" #include "fe-secure-common.h" #include "libpq-int.h" +#include "common/openssl.h" #ifdef WIN32 #include "win32.h" @@ -50,13 +51,6 @@ #include #endif -/* - * These SSL-related #includes must come after all system-provided headers. - * This ensures that OpenSSL can take care of conflicts with Windows' - * by #undef'ing the conflicting macros. (We don't directly - * include , but some other Windows headers do.) - */ -#include "common/openssl.h" #include #ifdef USE_SSL_ENGINE #include