tests/http: configure test httpd to honor client cipher order

Let the client, e.g. curl, influence the cipher selected in a TLS
handshake. TLS backends have different preferences and honor that
in httpd the same as Caddy does.

Also makes for a more fair compare of different TLS backends.

Closes #14338
This commit is contained in:
Stefan Eissing 2024-08-01 16:16:55 +02:00 committed by Daniel Stenberg
parent 754acd1a9d
commit f6cb3c6308
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 3 additions and 9 deletions

View File

@ -176,11 +176,11 @@ class TestSSLUse:
# test setting cipher suites, the AES 256 ciphers are disabled in the test server # test setting cipher suites, the AES 256 ciphers are disabled in the test server
@pytest.mark.parametrize("ciphers, succeed", [ @pytest.mark.parametrize("ciphers, succeed", [
[[0x1301], True], [[0x1301], True],
[[0x1302], False], [[0x1302], True],
[[0x1303], True], [[0x1303], True],
[[0x1302, 0x1303], True], [[0x1302, 0x1303], True],
[[0xC02B, 0xC02F], True], [[0xC02B, 0xC02F], True],
[[0xC02C, 0xC030], False], [[0xC02C, 0xC030], True],
[[0xCCA9, 0xCCA8], True], [[0xCCA9, 0xCCA8], True],
[[0xC02C, 0xC030, 0xCCA9, 0xCCA8], True], [[0xC02C, 0xC030, 0xCCA9, 0xCCA8], True],
]) ])

View File

@ -257,13 +257,7 @@ class Httpd:
f'Listen {self.env.proxys_port}', f'Listen {self.env.proxys_port}',
f'TypesConfig "{self._conf_dir}/mime.types', f'TypesConfig "{self._conf_dir}/mime.types',
f'SSLSessionCache "shmcb:ssl_gcache_data(32000)"', f'SSLSessionCache "shmcb:ssl_gcache_data(32000)"',
(f'SSLCipherSuite SSL' f'SSLHonorCipherOrder on',
f' ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256'
f':ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305'
),
(f'SSLCipherSuite TLSv1.3'
f' TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256'
),
] ]
if 'base' in self._extra_configs: if 'base' in self._extra_configs:
conf.extend(self._extra_configs['base']) conf.extend(self._extra_configs['base'])