Custom SSL/HSTS

Hello @DL6ER,

I have checked the branch out and can see the section present in the config. None of my attempts have made any difference to the output though. I have attempted the following:

  • Using the provided example ("ssl_cipher_list=AES128:!MD5").
  • Using the string from upstream (ssl_cipher_list ECDH+AESGCM+AES256:!aNULL:!MD5:!DSS).
  • Explicitly listing ciphers.
  • Setting a custom string to test removal of CBC (ssl_cipher_list=ECDH+AESGCM:!aNULL:!MD5:!DSS:!CBC:!RC4:!3DES:!LOW:!EXP:!eNULL).
  • Setting protocol version to 5 (shot in the dark, was to test if this would restrict to TLS 1.3 only).

None of these made any difference to the output. I also note that the example uses = while this is absent from upstream; I attempted both variants to no avail.

It is entirely possible I am being dense and missing something obvious, or that there is something obvious with my syntax.

I will likely come back to this during the week with fresher eyes and mind; if you have any ideas or pointers that would be great. Happy to do as much testing as needed.

Thanks again! Doubly so if I am being stupid :grinning_face_with_smiling_eyes:

I'm not exactly sure what you mean with "from upstream" but the expected syntax is indeed

option=value

and I verified this works for CivetWeb options.

The bad news: I did just check the CivetWeb source code in depth and, after a certain amount of digging, I found that the option ssl_cipher_list (among several others) is ignored when mbedtls is used as TLS library. You can set the algorithms only when OpenSSL is used right now.

Not that mbedtls does not support this but CivetWeb does not implement the necessary wrappers and, currently, simply hard-wires MBEDTLS_SSL_PRESET_DEFAULT during context initialization.

So one would need to add the necessary wrapper for CivetWeb. Probably a rather simple task. However, it will need a certain time time to sit down and read through the mbedtls documentation and figure what what needs to be added to mbed_sslctx_init() in mod_mbedtls.inl.

1 Like

That explains why the configuration does not take effect, thank you. At least now we know and i feel slightly better about being less of an idiot :grinning_face_with_smiling_eyes:

On the upstream point, I was referencing the file at civetweb/examples/https/civetweb.conf at master · civetweb/civetweb. I noted the lack of = in the strings, but either way we now know that is not the problem (but thank you for confirming).

I am happy to log a feature request for this if you would prefer. Thank you again for taking the time and making the effort to look into this!

You are welcome. I will try to allocate some time to read through the docs myself but no promises or ETA.

The feature has just hit FTL's development branch so it will be included in the next release. Make sure to switch back to master using

sudo pihole checkout ftl master

as the feature branch you are on will not receive any further updates. You can also try (note: no ftl)

sudo pihole checkout dev

but it is necessary to move all Pi-hole components onto development branches as there are already a few incompatible changes included. I will come back to you in case I have made any progress on the cipher selection issue with CivetWeb.

1 Like

I will be switching back to master tomorrow, I would rather not deviate from main unless something needs testing.

I appreciate what you have done so far, thank you. No urgency, whenever you get to it and I understand no guarantees :grinning_face_with_smiling_eyes:

You are invited to play around with branch new/tls_ciphers:

pihole checkout ftl new/tls_ciphers

It adds a new CLI option pihole-FTL --tls-ciphers listing all the available ciphers (we use the mbedtls library and you many have built it locally with support for only a subset of what is possible). Example on my system right now:

$ pihole-FTL --tls-ciphers

Supported TLS cipher suites:
- TLS1-3-CHACHA20-POLY1305-SHA256 (Cipher ID: 4867, Key length: 256 bits)
- TLS1-3-AES-256-GCM-SHA384 (Cipher ID: 4866, Key length: 256 bits)
- TLS1-3-AES-128-GCM-SHA256 (Cipher ID: 4865, Key length: 128 bits)
- TLS1-3-AES-128-CCM-SHA256 (Cipher ID: 4868, Key length: 128 bits)
- TLS1-3-AES-128-CCM-8-SHA256 (Cipher ID: 4869, Key length: 128 bits)
- TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 (Cipher ID: 52392, Key length: 256 bits)
- TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256 (Cipher ID: 52393, Key length: 256 bits)
- TLS-DHE-RSA-WITH-CHACHA20-POLY1305-SHA256 (Cipher ID: 52394, Key length: 256 bits)
- TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 (Cipher ID: 49196, Key length: 256 bits)
- TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384 (Cipher ID: 49200, Key length: 256 bits)
- TLS-DHE-RSA-WITH-AES-256-GCM-SHA384 (Cipher ID: 159, Key length: 256 bits)
- TLS-ECDHE-ECDSA-WITH-AES-256-CCM (Cipher ID: 49325, Key length: 256 bits)
- TLS-DHE-RSA-WITH-AES-256-CCM (Cipher ID: 49311, Key length: 256 bits)
- TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 (Cipher ID: 49188, Key length: 256 bits)
- TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384 (Cipher ID: 49192, Key length: 256 bits)
- TLS-DHE-RSA-WITH-AES-256-CBC-SHA256 (Cipher ID: 107, Key length: 256 bits)
- TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA (Cipher ID: 49162, Key length: 256 bits)
- TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA (Cipher ID: 49172, Key length: 256 bits)
- TLS-DHE-RSA-WITH-AES-256-CBC-SHA (Cipher ID: 57, Key length: 256 bits)
- TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 (Cipher ID: 49327, Key length: 256 bits)
- TLS-DHE-RSA-WITH-AES-256-CCM-8 (Cipher ID: 49315, Key length: 256 bits)
- TLS-ECDHE-ECDSA-WITH-CAMELLIA-256-GCM-SHA384 (Cipher ID: 49287, Key length: 256 bits)
- TLS-ECDHE-RSA-WITH-CAMELLIA-256-GCM-SHA384 (Cipher ID: 49291, Key length: 256 bits)
- TLS-DHE-RSA-WITH-CAMELLIA-256-GCM-SHA384 (Cipher ID: 49277, Key length: 256 bits)
- TLS-ECDHE-ECDSA-WITH-CAMELLIA-256-CBC-SHA384 (Cipher ID: 49267, Key length: 256 bits)
- TLS-ECDHE-RSA-WITH-CAMELLIA-256-CBC-SHA384 (Cipher ID: 49271, Key length: 256 bits)
- TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA256 (Cipher ID: 196, Key length: 256 bits)
- TLS-DHE-RSA-WITH-CAMELLIA-256-CBC-SHA (Cipher ID: 136, Key length: 256 bits)
- TLS-ECDHE-ECDSA-WITH-ARIA-256-GCM-SHA384 (Cipher ID: 49245, Key length: 256 bits)
- TLS-ECDHE-RSA-WITH-ARIA-256-GCM-SHA384 (Cipher ID: 49249, Key length: 256 bits)
- TLS-DHE-RSA-WITH-ARIA-256-GCM-SHA384 (Cipher ID: 49235, Key length: 256 bits)
- TLS-ECDHE-ECDSA-WITH-ARIA-256-CBC-SHA384 (Cipher ID: 49225, Key length: 256 bits)
- TLS-ECDHE-RSA-WITH-ARIA-256-CBC-SHA384 (Cipher ID: 49229, Key length: 256 bits)
- TLS-DHE-RSA-WITH-ARIA-256-CBC-SHA384 (Cipher ID: 49221, Key length: 256 bits)
- TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 (Cipher ID: 49195, Key length: 128 bits)
- TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 (Cipher ID: 49199, Key length: 128 bits)
- TLS-DHE-RSA-WITH-AES-128-GCM-SHA256 (Cipher ID: 158, Key length: 128 bits)
- TLS-ECDHE-ECDSA-WITH-AES-128-CCM (Cipher ID: 49324, Key length: 128 bits)
- TLS-DHE-RSA-WITH-AES-128-CCM (Cipher ID: 49310, Key length: 128 bits)
- TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 (Cipher ID: 49187, Key length: 128 bits)
- TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256 (Cipher ID: 49191, Key length: 128 bits)
- TLS-DHE-RSA-WITH-AES-128-CBC-SHA256 (Cipher ID: 103, Key length: 128 bits)
- TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA (Cipher ID: 49161, Key length: 128 bits)
- TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA (Cipher ID: 49171, Key length: 128 bits)
- TLS-DHE-RSA-WITH-AES-128-CBC-SHA (Cipher ID: 51, Key length: 128 bits)
- TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 (Cipher ID: 49326, Key length: 128 bits)
- TLS-DHE-RSA-WITH-AES-128-CCM-8 (Cipher ID: 49314, Key length: 128 bits)
- TLS-ECDHE-ECDSA-WITH-CAMELLIA-128-GCM-SHA256 (Cipher ID: 49286, Key length: 128 bits)
- TLS-ECDHE-RSA-WITH-CAMELLIA-128-GCM-SHA256 (Cipher ID: 49290, Key length: 128 bits)
- TLS-DHE-RSA-WITH-CAMELLIA-128-GCM-SHA256 (Cipher ID: 49276, Key length: 128 bits)
- TLS-ECDHE-ECDSA-WITH-CAMELLIA-128-CBC-SHA256 (Cipher ID: 49266, Key length: 128 bits)
- TLS-ECDHE-RSA-WITH-CAMELLIA-128-CBC-SHA256 (Cipher ID: 49270, Key length: 128 bits)
- TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA256 (Cipher ID: 190, Key length: 128 bits)
- TLS-DHE-RSA-WITH-CAMELLIA-128-CBC-SHA (Cipher ID: 69, Key length: 128 bits)
- TLS-ECDHE-ECDSA-WITH-ARIA-128-GCM-SHA256 (Cipher ID: 49244, Key length: 128 bits)
- TLS-ECDHE-RSA-WITH-ARIA-128-GCM-SHA256 (Cipher ID: 49248, Key length: 128 bits)
- TLS-DHE-RSA-WITH-ARIA-128-GCM-SHA256 (Cipher ID: 49234, Key length: 128 bits)
- TLS-ECDHE-ECDSA-WITH-ARIA-128-CBC-SHA256 (Cipher ID: 49224, Key length: 128 bits)
- TLS-ECDHE-RSA-WITH-ARIA-128-CBC-SHA256 (Cipher ID: 49228, Key length: 128 bits)
- TLS-DHE-RSA-WITH-ARIA-128-CBC-SHA256 (Cipher ID: 49220, Key length: 128 bits)
- TLS-ECDHE-PSK-WITH-CHACHA20-POLY1305-SHA256 (Cipher ID: 52396, Key length: 256 bits)
- TLS-DHE-PSK-WITH-CHACHA20-POLY1305-SHA256 (Cipher ID: 52397, Key length: 256 bits)
- TLS-DHE-PSK-WITH-AES-256-GCM-SHA384 (Cipher ID: 171, Key length: 256 bits)
- TLS-DHE-PSK-WITH-AES-256-CCM (Cipher ID: 49319, Key length: 256 bits)
- TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA384 (Cipher ID: 49208, Key length: 256 bits)
- TLS-DHE-PSK-WITH-AES-256-CBC-SHA384 (Cipher ID: 179, Key length: 256 bits)
- TLS-ECDHE-PSK-WITH-AES-256-CBC-SHA (Cipher ID: 49206, Key length: 256 bits)
- TLS-DHE-PSK-WITH-AES-256-CBC-SHA (Cipher ID: 145, Key length: 256 bits)
- TLS-DHE-PSK-WITH-CAMELLIA-256-GCM-SHA384 (Cipher ID: 49297, Key length: 256 bits)
- TLS-ECDHE-PSK-WITH-CAMELLIA-256-CBC-SHA384 (Cipher ID: 49307, Key length: 256 bits)
- TLS-DHE-PSK-WITH-CAMELLIA-256-CBC-SHA384 (Cipher ID: 49303, Key length: 256 bits)
- TLS-DHE-PSK-WITH-AES-256-CCM-8 (Cipher ID: 49323, Key length: 256 bits)
- TLS-DHE-PSK-WITH-ARIA-256-GCM-SHA384 (Cipher ID: 49261, Key length: 256 bits)
- TLS-ECDHE-PSK-WITH-ARIA-256-CBC-SHA384 (Cipher ID: 49265, Key length: 256 bits)
- TLS-DHE-PSK-WITH-ARIA-256-CBC-SHA384 (Cipher ID: 49255, Key length: 256 bits)
- TLS-DHE-PSK-WITH-AES-128-GCM-SHA256 (Cipher ID: 170, Key length: 128 bits)
- TLS-DHE-PSK-WITH-AES-128-CCM (Cipher ID: 49318, Key length: 128 bits)
- TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 (Cipher ID: 49207, Key length: 128 bits)
- TLS-DHE-PSK-WITH-AES-128-CBC-SHA256 (Cipher ID: 178, Key length: 128 bits)
- TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA (Cipher ID: 49205, Key length: 128 bits)
- TLS-DHE-PSK-WITH-AES-128-CBC-SHA (Cipher ID: 144, Key length: 128 bits)
- TLS-DHE-PSK-WITH-CAMELLIA-128-GCM-SHA256 (Cipher ID: 49296, Key length: 128 bits)
- TLS-DHE-PSK-WITH-CAMELLIA-128-CBC-SHA256 (Cipher ID: 49302, Key length: 128 bits)
- TLS-ECDHE-PSK-WITH-CAMELLIA-128-CBC-SHA256 (Cipher ID: 49306, Key length: 128 bits)
- TLS-DHE-PSK-WITH-AES-128-CCM-8 (Cipher ID: 49322, Key length: 128 bits)
- TLS-DHE-PSK-WITH-ARIA-128-GCM-SHA256 (Cipher ID: 49260, Key length: 128 bits)
- TLS-ECDHE-PSK-WITH-ARIA-128-CBC-SHA256 (Cipher ID: 49264, Key length: 128 bits)
- TLS-DHE-PSK-WITH-ARIA-128-CBC-SHA256 (Cipher ID: 49254, Key length: 128 bits)
- TLS-RSA-WITH-AES-256-GCM-SHA384 (Cipher ID: 157, Key length: 256 bits)
- TLS-RSA-WITH-AES-256-CCM (Cipher ID: 49309, Key length: 256 bits)
- TLS-RSA-WITH-AES-256-CBC-SHA256 (Cipher ID: 61, Key length: 256 bits)
- TLS-RSA-WITH-AES-256-CBC-SHA (Cipher ID: 53, Key length: 256 bits)
- TLS-ECDH-RSA-WITH-AES-256-GCM-SHA384 (Cipher ID: 49202, Key length: 256 bits)
- TLS-ECDH-RSA-WITH-AES-256-CBC-SHA384 (Cipher ID: 49194, Key length: 256 bits)
- TLS-ECDH-RSA-WITH-AES-256-CBC-SHA (Cipher ID: 49167, Key length: 256 bits)
- TLS-ECDH-ECDSA-WITH-AES-256-GCM-SHA384 (Cipher ID: 49198, Key length: 256 bits)
- TLS-ECDH-ECDSA-WITH-AES-256-CBC-SHA384 (Cipher ID: 49190, Key length: 256 bits)
- TLS-ECDH-ECDSA-WITH-AES-256-CBC-SHA (Cipher ID: 49157, Key length: 256 bits)
- TLS-RSA-WITH-AES-256-CCM-8 (Cipher ID: 49313, Key length: 256 bits)
- TLS-RSA-WITH-CAMELLIA-256-GCM-SHA384 (Cipher ID: 49275, Key length: 256 bits)
- TLS-RSA-WITH-CAMELLIA-256-CBC-SHA256 (Cipher ID: 192, Key length: 256 bits)
- TLS-RSA-WITH-CAMELLIA-256-CBC-SHA (Cipher ID: 132, Key length: 256 bits)
- TLS-ECDH-RSA-WITH-CAMELLIA-256-GCM-SHA384 (Cipher ID: 49293, Key length: 256 bits)
- TLS-ECDH-RSA-WITH-CAMELLIA-256-CBC-SHA384 (Cipher ID: 49273, Key length: 256 bits)
- TLS-ECDH-ECDSA-WITH-CAMELLIA-256-GCM-SHA384 (Cipher ID: 49289, Key length: 256 bits)
- TLS-ECDH-ECDSA-WITH-CAMELLIA-256-CBC-SHA384 (Cipher ID: 49269, Key length: 256 bits)
- TLS-ECDH-ECDSA-WITH-ARIA-256-GCM-SHA384 (Cipher ID: 49247, Key length: 256 bits)
- TLS-ECDH-RSA-WITH-ARIA-256-GCM-SHA384 (Cipher ID: 49251, Key length: 256 bits)
- TLS-RSA-WITH-ARIA-256-GCM-SHA384 (Cipher ID: 49233, Key length: 256 bits)
- TLS-ECDH-ECDSA-WITH-ARIA-256-CBC-SHA384 (Cipher ID: 49227, Key length: 256 bits)
- TLS-ECDH-RSA-WITH-ARIA-256-CBC-SHA384 (Cipher ID: 49231, Key length: 256 bits)
- TLS-RSA-WITH-ARIA-256-CBC-SHA384 (Cipher ID: 49213, Key length: 256 bits)
- TLS-RSA-WITH-AES-128-GCM-SHA256 (Cipher ID: 156, Key length: 128 bits)
- TLS-RSA-WITH-AES-128-CCM (Cipher ID: 49308, Key length: 128 bits)
- TLS-RSA-WITH-AES-128-CBC-SHA256 (Cipher ID: 60, Key length: 128 bits)
- TLS-RSA-WITH-AES-128-CBC-SHA (Cipher ID: 47, Key length: 128 bits)
- TLS-ECDH-RSA-WITH-AES-128-GCM-SHA256 (Cipher ID: 49201, Key length: 128 bits)
- TLS-ECDH-RSA-WITH-AES-128-CBC-SHA256 (Cipher ID: 49193, Key length: 128 bits)
- TLS-ECDH-RSA-WITH-AES-128-CBC-SHA (Cipher ID: 49166, Key length: 128 bits)
- TLS-ECDH-ECDSA-WITH-AES-128-GCM-SHA256 (Cipher ID: 49197, Key length: 128 bits)
- TLS-ECDH-ECDSA-WITH-AES-128-CBC-SHA256 (Cipher ID: 49189, Key length: 128 bits)
- TLS-ECDH-ECDSA-WITH-AES-128-CBC-SHA (Cipher ID: 49156, Key length: 128 bits)
- TLS-RSA-WITH-AES-128-CCM-8 (Cipher ID: 49312, Key length: 128 bits)
- TLS-RSA-WITH-CAMELLIA-128-GCM-SHA256 (Cipher ID: 49274, Key length: 128 bits)
- TLS-RSA-WITH-CAMELLIA-128-CBC-SHA256 (Cipher ID: 186, Key length: 128 bits)
- TLS-RSA-WITH-CAMELLIA-128-CBC-SHA (Cipher ID: 65, Key length: 128 bits)
- TLS-ECDH-RSA-WITH-CAMELLIA-128-GCM-SHA256 (Cipher ID: 49292, Key length: 128 bits)
- TLS-ECDH-RSA-WITH-CAMELLIA-128-CBC-SHA256 (Cipher ID: 49272, Key length: 128 bits)
- TLS-ECDH-ECDSA-WITH-CAMELLIA-128-GCM-SHA256 (Cipher ID: 49288, Key length: 128 bits)
- TLS-ECDH-ECDSA-WITH-CAMELLIA-128-CBC-SHA256 (Cipher ID: 49268, Key length: 128 bits)
- TLS-ECDH-ECDSA-WITH-ARIA-128-GCM-SHA256 (Cipher ID: 49246, Key length: 128 bits)
- TLS-ECDH-RSA-WITH-ARIA-128-GCM-SHA256 (Cipher ID: 49250, Key length: 128 bits)
- TLS-RSA-WITH-ARIA-128-GCM-SHA256 (Cipher ID: 49232, Key length: 128 bits)
- TLS-ECDH-ECDSA-WITH-ARIA-128-CBC-SHA256 (Cipher ID: 49226, Key length: 128 bits)
- TLS-ECDH-RSA-WITH-ARIA-128-CBC-SHA256 (Cipher ID: 49230, Key length: 128 bits)
- TLS-RSA-WITH-ARIA-128-CBC-SHA256 (Cipher ID: 49212, Key length: 128 bits)
- TLS-RSA-PSK-WITH-CHACHA20-POLY1305-SHA256 (Cipher ID: 52398, Key length: 256 bits)
- TLS-RSA-PSK-WITH-AES-256-GCM-SHA384 (Cipher ID: 173, Key length: 256 bits)
- TLS-RSA-PSK-WITH-AES-256-CBC-SHA384 (Cipher ID: 183, Key length: 256 bits)
- TLS-RSA-PSK-WITH-AES-256-CBC-SHA (Cipher ID: 149, Key length: 256 bits)
- TLS-RSA-PSK-WITH-CAMELLIA-256-GCM-SHA384 (Cipher ID: 49299, Key length: 256 bits)
- TLS-RSA-PSK-WITH-CAMELLIA-256-CBC-SHA384 (Cipher ID: 49305, Key length: 256 bits)
- TLS-RSA-PSK-WITH-ARIA-256-GCM-SHA384 (Cipher ID: 49263, Key length: 256 bits)
- TLS-RSA-PSK-WITH-ARIA-256-CBC-SHA384 (Cipher ID: 49257, Key length: 256 bits)
- TLS-RSA-PSK-WITH-AES-128-GCM-SHA256 (Cipher ID: 172, Key length: 128 bits)
- TLS-RSA-PSK-WITH-AES-128-CBC-SHA256 (Cipher ID: 182, Key length: 128 bits)
- TLS-RSA-PSK-WITH-AES-128-CBC-SHA (Cipher ID: 148, Key length: 128 bits)
- TLS-RSA-PSK-WITH-CAMELLIA-128-GCM-SHA256 (Cipher ID: 49298, Key length: 128 bits)
- TLS-RSA-PSK-WITH-CAMELLIA-128-CBC-SHA256 (Cipher ID: 49304, Key length: 128 bits)
- TLS-RSA-PSK-WITH-ARIA-128-GCM-SHA256 (Cipher ID: 49262, Key length: 128 bits)
- TLS-RSA-PSK-WITH-ARIA-128-CBC-SHA256 (Cipher ID: 49256, Key length: 128 bits)
- TLS-PSK-WITH-CHACHA20-POLY1305-SHA256 (Cipher ID: 52395, Key length: 256 bits)
- TLS-PSK-WITH-AES-256-GCM-SHA384 (Cipher ID: 169, Key length: 256 bits)
- TLS-PSK-WITH-AES-256-CCM (Cipher ID: 49317, Key length: 256 bits)
- TLS-PSK-WITH-AES-256-CBC-SHA384 (Cipher ID: 175, Key length: 256 bits)
- TLS-PSK-WITH-AES-256-CBC-SHA (Cipher ID: 141, Key length: 256 bits)
- TLS-PSK-WITH-CAMELLIA-256-GCM-SHA384 (Cipher ID: 49295, Key length: 256 bits)
- TLS-PSK-WITH-CAMELLIA-256-CBC-SHA384 (Cipher ID: 49301, Key length: 256 bits)
- TLS-PSK-WITH-AES-256-CCM-8 (Cipher ID: 49321, Key length: 256 bits)
- TLS-PSK-WITH-ARIA-256-GCM-SHA384 (Cipher ID: 49259, Key length: 256 bits)
- TLS-PSK-WITH-ARIA-256-CBC-SHA384 (Cipher ID: 49253, Key length: 256 bits)
- TLS-PSK-WITH-AES-128-GCM-SHA256 (Cipher ID: 168, Key length: 128 bits)
- TLS-PSK-WITH-AES-128-CCM (Cipher ID: 49316, Key length: 128 bits)
- TLS-PSK-WITH-AES-128-CBC-SHA256 (Cipher ID: 174, Key length: 128 bits)
- TLS-PSK-WITH-AES-128-CBC-SHA (Cipher ID: 140, Key length: 128 bits)
- TLS-PSK-WITH-CAMELLIA-128-GCM-SHA256 (Cipher ID: 49294, Key length: 128 bits)
- TLS-PSK-WITH-CAMELLIA-128-CBC-SHA256 (Cipher ID: 49300, Key length: 128 bits)
- TLS-PSK-WITH-AES-128-CCM-8 (Cipher ID: 49320, Key length: 128 bits)
- TLS-PSK-WITH-ARIA-128-GCM-SHA256 (Cipher ID: 49258, Key length: 128 bits)
- TLS-PSK-WITH-ARIA-128-CBC-SHA256 (Cipher ID: 49252, Key length: 128 bits)

When I no go ahead and run

sudo pihole-FTL --config webserver.advancedOpts '["ssl_cipher_list=TLS1-3-AES-256-GCM-SHA384"]'

I get this in my Firefox:


or

sudo pihole-FTL --config webserver.advancedOpts '["ssl_cipher_list=TLS1-3-CHACHA20-POLY1305-SHA256"]'


This sets the list of allowed ciphersuites and the preference order (comma-separated strings). First in the list means the highest preference. The list of ciphersuites passed to this config option may contain a mixture of TLS 1.2 and TLS 1.3 ciphersuite identifiers. This is useful if negotiation of TLS 1.3 should be attempted, but a fallback to TLS 1.2 would be tolerated.

This is more a feasibility study, my next plan is to submit this upstream into the CivetWeb project, but that's for another day.

1 Like

Thank you @DL6ER, much appreciated - will set time aside tomorrow or Thursday to have a go at this. You are describing exactly what I intend to do: manually specify a handful of ciphers with 1.3 preferred and 1.2 as fallback if required.

I note you say it adds a new CLI option; does this function the same as the other options and inject into the config file via the API? Also, if there is any specific testing you would like me to do, I am happy to oblige.

Much appreciated once again, thank you :smile:

Upstream PR created:

1 Like

Hello @DL6ER,

First to answer my own question: this is what happens when you are tired and reply late at night. I confused CLI option with config option, my mistake (the string is indeed entered into the toml file as expected).

The good news is that it works perfectly :smile: thank you! One thing I did notice in my scan was the ordering, but it might be coming from somewhere else:

I do not see this as an issue; even if client preference kicks in, the client will still be constrained by what the server has available. This could also be coming from elsewhere on the system, merely pointing out for completeness.

What are the chances of this making it into master, and is there anything I can test for you or assist with?

So far, all our submitted changes were accepted in CivetWeb. Initial response time varied from hours to months in the past so I have no real idea. Once it hits, we definitely can add this to Pi-hole.

The order should work, see the comment here:

I am not sure how to read/interpret your screenshot but if it does not work, one might need to file a mbedtls bug report...

Honestly I don’t view it as enough of an issue, although I also accept that such an approach would also lead to bugs never being fixed in the first place. Suspect the ordering is coming from somewhere else but cannot prove it. For reference, I am using testssl to scan: testssl/testssl.sh: Testing TLS/SSL encryption anywhere on any port

The snip shows the order in which ciphers will be selected, hence the statement for 1.3 saying no order received. I have seen this before with OpenSSL, hence why I say it may be coming from elsewhere.

I will likely remain on this branch then until the next release. Thank you for all your help and effort, I really appreciate it :smile:

Yes. An argument may be that TLS1.3 anyway supports only strong cipher suites (and only five in total), so why not deciding according to the client's preferences.

Maybe it's a mobile device that has native (hardware) support optimized for one specific thing (like SHA256 but not SHA384 and AES128 rather than AES256) so it might want to optimize for performance = battery life. Additionally, often browsers are better maintained than web servers updated so when a cipher is known to be "broken" at any point, browsers will likely rather quickly deprecate it (well, we'd be quick with the according Pi-hole update, too, but I see this more like a general argument).

I also found this in the same header file I already linked above:

By default, the server chooses its preferred ciphersuite among those that the client supports. If mbedtls_ssl_conf_preference_order() is called to prefer the client's preferences, the server instead chooses the client's preferred ciphersuite among those that the server supports.

Neither we nor CivetWeb uses this function so it should indeed be server prioritization.

1 Like

A further point (and why I would not recommend my configuration to anyone) is that any changes to cipher availability/selection for TLS 1.3 is a violation of RFC 8446. I agree with your statement though; if the list of available ciphers is considered secure, I do not see any issues with letting the client decide. As you say. mobile devices for example may prefer ChaCha20 due to hardware support etc.

On the browser topic - yes, absolutely agreed on all points again :grinning_face_with_smiling_eyes: I shall do a bit of digging on my system, but the question of selection is not an issue for me with restricted ciphers available.

And with

sudo pihole-FTL --config webserver.advancedOpts '["ssl_cipher_list=TLS1-3-CHACHA20-POLY1305-SHA256,TLS1-3-AES-256-GCM-SHA384"]'

we furthermore get:

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.