diff options
-rw-r--r-- | src/backend/libpq/be-secure.c | 6 | ||||
-rw-r--r-- | src/interfaces/libpq/fe-secure.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/backend/libpq/be-secure.c b/src/backend/libpq/be-secure.c index f595e8f4240..64efac001b1 100644 --- a/src/backend/libpq/be-secure.c +++ b/src/backend/libpq/be-secure.c @@ -728,6 +728,12 @@ initialize_SSL(void) SSLerrmessage()))); /* + * Disable OpenSSL's moving-write-buffer sanity check, because it + * causes unnecessary failures in nonblocking send cases. + */ + SSL_CTX_set_mode(SSL_context, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER); + + /* * Load and verify certificate and private key */ if (SSL_CTX_use_certificate_file(SSL_context, diff --git a/src/interfaces/libpq/fe-secure.c b/src/interfaces/libpq/fe-secure.c index 9c4f636d3e7..769a36a0606 100644 --- a/src/interfaces/libpq/fe-secure.c +++ b/src/interfaces/libpq/fe-secure.c @@ -900,6 +900,12 @@ init_ssl_system(PGconn *conn) #endif return -1; } + + /* + * Disable OpenSSL's moving-write-buffer sanity check, because it + * causes unnecessary failures in nonblocking send cases. + */ + SSL_CTX_set_mode(SSL_context, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER); } #ifdef ENABLE_THREAD_SAFETY pthread_mutex_unlock(&init_mutex); |