-
-
Notifications
You must be signed in to change notification settings - Fork 405
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
backends: allow setting TLS version and ciphers #2246
Conversation
I don't know what to flag this, since it moves from feature towards bugfix as 3.10 becomes more widely available. I put it on 8.0 since that's when we drop old-python, but sopel 7 will have these default changes applied anyway by py3.10, with no knobs to dial it back.
RFC: Should I add a knob to change the minimum SSL/TLS version? |
37f00eb
to
366489c
Compare
Thinking more about it, are CNAMEs used for anything where the user can't just update their config? |
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.
I've reached my limit of digging through SSL/TLS docs for today.
Some knob to override the minimum TLS version would probably be useful, given that IRC networks often seem to fall behind on encryption support vs. the much more common HTTP services we all use every day. No, I would not suggest making this knob support anything ridiculous like SSLv3.
I know you referenced the shocking number of servers that still don't have any TLS support at all as of December 2021. Presumably TLSv1.2 is a sane default (it enjoys support by 54% of surveyed servers, vs. 56% for "any SSL protocol"), but we'd probably do well to allow people the option to explicitly enable at least TLSv1.1 if their network of choice doesn't support anything newer. I can take or leave TLSv1.0.
I don't like storing the min_ver string, but I'm not sure if the validation belongs there, but "invalid version TLSv5" is much more useful than "invalid version None"... 🤔 |
Would you agree that putting the ini example code before the I wish English had a reliable linter, too. |
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.
I wonder if you can use SSLContext.load_verify_locations
instead of doing any manual verification, because those look like a lot of work and I'm not really comfortable with that.
I'm OK with the default minimum TLS version. I think it's fair anyway, at least if we target Sopel 8 for that (as we should, I think). |
edc4f18
to
6a6ee58
Compare
I'm not sure what you mean about |
The more I think about it, the less I understand why Sopel does that. Certificates are not supposed to care about CNAME or anything, they only care about the domain name. If someone has a certificate, they must ensure it's valid for all the domain names they want to use, and that includes A records and CNAME, and any other DNS records anyway. And yes, I was thinking of just letting the SSLContext do its work and never bother with manual check of hostname. Note: #2256 embed parts of that implementation (without the TLS min version) and you should check it, it's pretty cool IMO. |
Are you two going to make me decide whether to merge this and then immediately replace it with the |
I didn't implement TLS specifically to let @half-duplex see if what I did with SSLContext was in line with his work and if he would like to add TLS on top on my PR. But I don't think it's a good idea to merge this PR, given that the asyncio one is really changing a lot of things. |
That's why I asked if you guys were planning to work together on it (TLS) and avoid the conflicts before they start. 😺 |
640c2da
to
42ee312
Compare
42ee312
to
854c18d
Compare
854c18d
to
5840f84
Compare
5840f84
to
b183b72
Compare
Rebased on (so depends on) #2256 |
cb94785
to
9574e45
Compare
9574e45
to
d909099
Compare
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.
I love it! So simple in the end to add these settings.
9a54600
to
59e846e
Compare
@Exirel Is this good to go for real? Time to squash? |
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.
Yeah all good!
59e846e
to
1b9f86d
Compare
Description
This resolves a TODO comment and two LGTM ignores regarding failing to specify a minimum SSL/TLS version for connections. It also introduces a new core config option,
tls_ciphers
, since python 3.10 tightens the defaults.Checklist
make qa
(runsmake quality
andmake test
)