New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dnsdist: prioritize ChaCha20-Poly1305 when client does #9510
Conversation
A+ description! |
The spell check is failing for:
I thought I had made a typo but it seems like the CI does not recognize the word :) |
You can add the word here: https://github.com/azadi/pdns/blob/dnsdist-prioritize-chacha/.github/actions/spell-check/expect.txt |
There's a trade-off between having an extremely broad dictionary and having one that's too narrow. Right now we're somewhere in the middle, in that each project has to add some words, and projects periodically use incorrect words -- words that are technically words -- e.g. spae and untill, but practically typos. I do hope to adjust the dictionary going forward (dropping archaic words and adding longer words, possibly based on a survey of which words real consumers are using). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR! The change makes sense to me, and for the record it has been merged in HAProxy as well.
Do you need some help fixing the spell check issue?
Should the docs say something about OpenSSL-only? |
That sounds like a good idea! And perhaps that it only exists in 1.1.1+? |
The OpenSSL option SSL_OP_PRIORITIZE_CHACHA prioritizes ChaCha20-Poly1305 if the client does by temporarily re-prioritizing it to the top of the server cipher list. Since dnsdist already sets SSL_OP_CIPHER_SERVER_PREFERENCE by default (preferServerCiphers is set to true), setting this option enables clients that prefer ChaCha20 due to a lack of AES-NI (such as mobile devices) to override the server specified list. This option requires SSL_OP_CIPHER_SERVER_PREFERENCE to be set and was introduced in OpenSSL 1.1.1. Note that this change neither affects clients that prefer AES or other ciphers, nor dnsdist's default options, unless the client explicitly prioritizes ChaCha20.
49c1c21
to
9f9ef46
Compare
Thanks for the feedback; I have updated the PR to reflect in the documentation that this change only applies to OpenSSL 1.1.1+. |
Short description
The OpenSSL option SSL_OP_PRIORITIZE_CHACHA prioritizes ChaCha20-Poly1305 if the client does by temporarily re-prioritizing it to the top of the server cipher list. Since dnsdist already sets SSL_OP_CIPHER_SERVER_PREFERENCE by default (preferServerCiphers is set to true), setting this option enables clients that prefer ChaCha20 due to a lack of AES-NI (such as mobile devices) to override the server specified list. This option requires SSL_OP_CIPHER_SERVER_PREFERENCE to be set and was introduced in OpenSSL 1.1.1.
Note that this change neither affects clients that prefer AES or other ciphers, nor dnsdist's default options, unless the client explicitly prioritizes ChaCha20.
Checklist
I have:
I have not added regression or unit tests as I was not sure if they are required for code that doesn't change dnsdist's functionality but just adds an option for OpenSSL; I tried to find existing tests for similar changes but couldn't. Please let me know if that should not be the case and I need to add tests for this change.
Testing
For testing this, the dnsdist.conf was:
(
preferServerCiphers
is set to true, which is dnsdist's default. I didn't explicitly setciphers
.)With this change,
returns the negotiated cipher:
Without this change (current dnsdist):
returns:
Additionally, I also ran
testssl
. With the change,Output without the change: