aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-secure.c
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2011-11-28 13:13:42 +0100
committerMagnus Hagander <magnus@hagander.net>2011-11-28 13:13:42 +0100
commit64aea1ebc70dc597b79e2f7f4451472510a1e9bf (patch)
tree3cb08879f2083258aa694fe981d56dd30d44349b /src/interfaces/libpq/fe-secure.c
parentdd3bab5fd74db009c946278bb314c8458a2fef11 (diff)
downloadpostgresql-64aea1ebc70dc597b79e2f7f4451472510a1e9bf.tar.gz
postgresql-64aea1ebc70dc597b79e2f7f4451472510a1e9bf.zip
Add libpq connection option to disable SSL compression
This can be used to remove the overhead of SSL compression on fast networks. Laurenz Albe
Diffstat (limited to 'src/interfaces/libpq/fe-secure.c')
-rw-r--r--src/interfaces/libpq/fe-secure.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/interfaces/libpq/fe-secure.c b/src/interfaces/libpq/fe-secure.c
index 9c6ced6a828..c6963bed948 100644
--- a/src/interfaces/libpq/fe-secure.c
+++ b/src/interfaces/libpq/fe-secure.c
@@ -1292,6 +1292,16 @@ initialize_SSL(PGconn *conn)
}
}
+ /*
+ * If the OpenSSL version used supports it (from 1.0.0 on)
+ * and the user requested it, disable SSL compression.
+ */
+#ifdef SSL_OP_NO_COMPRESSION
+ if (conn->sslcompression && conn->sslcompression[0] == '0') {
+ SSL_set_options(conn->ssl, SSL_OP_NO_COMPRESSION);
+ }
+#endif
+
return 0;
}