[pve-devel] [PATCH manager v2 2/3] pveproxy: add configurable COMPRESSION

Stoiko Ivanov s.ivanov at proxmox.com
Tue Feb 19 19:18:43 CET 2019


disabling http compression is considered good practice and certain TLS-testing
scripts/sites lower the security rating if it's enabled.

compression is still on by default for the potential speed/performance gain.

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 PVE/API2Tools.pm        | 3 ++-
 PVE/Service/pveproxy.pm | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/PVE/API2Tools.pm b/PVE/API2Tools.pm
index fd2f656d..b2e3a6bd 100644
--- a/PVE/API2Tools.pm
+++ b/PVE/API2Tools.pm
@@ -223,6 +223,7 @@ sub read_proxy_config {
     $shcmd .= 'echo \"CIPHERS:\$CIPHERS\";';
     $shcmd .= 'echo \"DHPARAMS:\$DHPARAMS\";';
     $shcmd .= 'echo \"HONOR_CIPHER_ORDER:\$HONOR_CIPHER_ORDER\";';
+    $shcmd .= 'echo \"COMPRESSION:\$COMPRESSION\";';
 
     my $data = -f $conffile ? `bash -c "$shcmd"` : '';
 
@@ -245,7 +246,7 @@ sub read_proxy_config {
 	    $res->{$key} = $value;
 	} elsif ($key eq 'DHPARAMS') {
 	    $res->{$key} = $value;
-	} elsif ($key eq 'HONOR_CIPHER_ORDER') {
+	} elsif ($key eq 'HONOR_CIPHER_ORDER' || $key eq 'COMPRESSION') {
 	    die "unknown value '$value' - use 0 or 1\n" if $value !~ m/^(0|1)$/;
 	    $res->{$key} = $value;
 	} else {
diff --git a/PVE/Service/pveproxy.pm b/PVE/Service/pveproxy.pm
index e984cb8c..7a4a804f 100755
--- a/PVE/Service/pveproxy.pm
+++ b/PVE/Service/pveproxy.pm
@@ -111,6 +111,7 @@ sub init {
 	    cert_file => '/etc/pve/local/pve-ssl.pem',
 	    honor_cipher_order => $proxyconf->{HONOR_CIPHER_ORDER},
 	},
+	compression => $proxyconf->{COMPRESSION},
 	# Note: there is no authentication for those pages and dirs!
 	pages => {
 	    '/' => sub { get_index($self->{nodename}, @_) },
-- 
2.11.0




More information about the pve-devel mailing list