]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Portability: only use SSL compression when available
authorStuart Henderson <stu@spacehopper.org>
Mon, 2 Mar 2015 14:50:43 +0000 (06:50 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 2 Mar 2015 14:50:43 +0000 (06:50 -0800)
Compression in SSL/TLS is deprecated. LibreSSL, BoringSSL, and some
OpenSSL builds do not contain support for it at all.

src/ssl/bio.cc

index 7647a5f68689430873126edea5f7c7b81d9539d6..68882e9552afd443709edce6bbeec632ba45d246 100644 (file)
@@ -325,7 +325,12 @@ adjustSSL(SSL *ssl, Ssl::Bio::sslFeatures &features)
 
     // If the client supports compression but our context does not support
     // we can not adjust.
-    if (features.compressMethod && ssl->ctx->comp_methods == NULL) {
+#if defined(OPENSSL_NO_COMP)
+    const bool requireCompression = (features.compressMethod && ssl->ctx->comp_methods == NULL);
+#else
+    const bool requireCompression = features.compressMethod;
+#endif
+    if (requireCompression) {
         debugs(83, 5, "Client Hello Data supports compression, but we do not!");
         return false;
     }
@@ -669,9 +674,11 @@ Ssl::Bio::sslFeatures::get(const SSL *ssl)
     debugs(83, 7, "SNI server name: " << serverName);
 #endif
 
+#if defined(OPENSSL_NO_COMP)
     if (ssl->session->compress_meth)
         compressMethod = ssl->session->compress_meth;
     else if (sslVersion >= 3) //if it is 3 or newer version then compression is disabled
+#endif
         compressMethod = 0;
     debugs(83, 7, "SSL compression: " << compressMethod);