]> git.proxmox.com Git - pve-manager.git/commitdiff
pveproxy: add configurable HONOR_CIPHER_ORDER
authorStoiko Ivanov <s.ivanov@proxmox.com>
Tue, 19 Feb 2019 18:18:42 +0000 (19:18 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 20 Feb 2019 06:15:38 +0000 (07:15 +0100)
fix #2069 (the report includes rationale and also information on test-cases).

Tested by:
* running testssl.sh [0]
* enabling this setting (our default cipherlist prefers AES256,
  chromium on stretch AES128)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
PVE/API2Tools.pm
PVE/Service/pveproxy.pm

index 7527b42be92cefaeb85966dbad1b4c6053899616..fd2f656dcf8c781753ca4863364c0b97667fc13e 100644 (file)
@@ -222,6 +222,7 @@ sub read_proxy_config {
     $shcmd .= 'echo \"POLICY:\$POLICY\";';
     $shcmd .= 'echo \"CIPHERS:\$CIPHERS\";';
     $shcmd .= 'echo \"DHPARAMS:\$DHPARAMS\";';
+    $shcmd .= 'echo \"HONOR_CIPHER_ORDER:\$HONOR_CIPHER_ORDER\";';
 
     my $data = -f $conffile ? `bash -c "$shcmd"` : '';
 
@@ -229,7 +230,7 @@ sub read_proxy_config {
 
     while ($data =~ s/^(.*)\n//) {
        my ($key, $value) = split(/:/, $1, 2);
-       next if !$value;
+       next if !defined($value) || $value eq '';
        if ($key eq 'ALLOW_FROM' || $key eq 'DENY_FROM') {
            my $ips = [];
            foreach my $ip (split(/,/, $value)) {
@@ -244,6 +245,9 @@ sub read_proxy_config {
            $res->{$key} = $value;
        } elsif ($key eq 'DHPARAMS') {
            $res->{$key} = $value;
+       } elsif ($key eq 'HONOR_CIPHER_ORDER') {
+           die "unknown value '$value' - use 0 or 1\n" if $value !~ m/^(0|1)$/;
+           $res->{$key} = $value;
        } else {
            # silently skip everythin else?
        }
index ee6c28d4dfaf0b1acb53525d04c46ce5cc846ce8..e984cb8c9f39b361bcb810d84dcc4af130f15916 100755 (executable)
@@ -109,6 +109,7 @@ sub init {
            cipher_list => $proxyconf->{CIPHERS} || 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256',
            key_file => '/etc/pve/local/pve-ssl.key',
            cert_file => '/etc/pve/local/pve-ssl.pem',
+           honor_cipher_order => $proxyconf->{HONOR_CIPHER_ORDER},
        },
        # Note: there is no authentication for those pages and dirs!
        pages => {