diff --git a/src/backend/libpq/be-secure.c b/src/backend/libpq/be-secure.c
new file mode 100644
index 4e8faa4..98c87ad
*** a/src/backend/libpq/be-secure.c
--- b/src/backend/libpq/be-secure.c
*************** initialize_SSL(void)
*** 742,747 ****
--- 742,754 ----
  		 */
  		SSL_CTX_set_mode(SSL_context, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
  
+ #if SSLEAY_VERSION_NUMBER >= 0x10000000L
+ 		/*
+ 		 * Disable OpenSSL's data compression in versions which support it.
+ 		 */
+ 		SSL_CTX_set_mode(SSL_context, SSL_OP_NO_COMPRESSION);
+ #endif
+ 
  		/*
  		 * Load and verify server's certificate and private key
  		 */
