diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c index 39b1a66236..d77e6af7dd 100644 --- a/src/backend/libpq/be-secure-openssl.c +++ b/src/backend/libpq/be-secure-openssl.c @@ -38,11 +38,16 @@ #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.) + * On Windows, includes a #define for X509_NAME, which breaks our + * ability to use OpenSSL's version of that symbol if is pulled + * in after (which is being done here as "libpq/libpq.h" indirectly + * includes when gssapi is enabled). We can't reliably fix that by + * re-ordering includes. Instead, just zap the #define again here. */ +#ifdef X509_NAME +#undef X509_NAME +#endif + #include "common/openssl.h" #include #include