-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
ssl: TLS 1.0 and 1.1 are enabled by default #8079
Comments
If you execute ssl:versions() you will get
The application will check and use application environment variable that can be set by node start parameters or by node configuration file, this however will always be overridden by explicit configuration in to ssl API functions. And the application variable will override the default. In OTP-25 shell
{3,4} = TLS-1.3 and {3,3} = TLS-1.2 So it appears that the application variable has been set in your case if you have support for TLS-1.0 and TLS-1.1 ?MIN_SUPPORTED_VERSIONS in dtls_record is however a bug , thank you for pointing it out. We will fix that. |
Thanks a lot for looking into this. I'm a bit surprised but I did create
a reproducer to check the actual behavior[1] and sslscan indeed reported
only TLS 1.2 and 1.3 were enabled.
[1] I'm going over various servers because it turns out there are often
discrepencies between actual configurations and expected ones
```
-module(ssltest).
-export([f/0]).
loop(ListenSocket) ->
{ok, Socket} = ssl:transport_accept(ListenSocket),
_ = ssl:handshake(Socket),
_ = ssl:close(Socket),
loop(ListenSocket).
f() ->
ssl:start(),
{ok, ListenSocket} = ssl:listen(9999, [{certfile, "/etc/ssl/certs/ssl-cert-snakeoil.pem"}, {keyfile, "/etc/ssl/ssl-cert-snakeoil-666-perms.key"}, {reuseaddr, true}]),
loop(ListenSocket).
```
Anyway, thanks again and sorry for the noise. I'll try to dig more and
will instead see on the rabbitmq side where I noticed these protocols
being enabled. Feel free to close this issue now or
?MIN_SUPPORTED_VERSIONS is changed.
|
* ingela/ssl/dtls-default/GH-8079/OTP-18962: ssl: Correct default value
I was going over the Ubuntu packages (in "main", not "universe"), looking for servers that still offer TLS 1.0 and 1.1 and noticed that rabbitmq does. It's not a default from rabbitmq; instead it's the behavior from
ssl
unless rabbitmq passes specific configuration. Note that I'm not well-versed in erlang and OTP so I may be missing obvious things but the main difficulty might be various parts of the code drifting apart.Consider this from
lib/ssl/src/ssl_internal.hrl
:The comment should be updated although I don't know if it states the TLS 1.1 protocol is under development, or its support in otp is.
In any case, the more important part is probably about TLS 1.3 and 1.2 being the default versions which doesn't match what I saw. I believe the issue lies in
lib/ssl/src/ssl.erl
:Replacing with the line that follows makes the behavior match my understanding of the comments above:
After this change, rabbitmq offers only TLS 1.3 and 1.2 if not configured otherwise and can still be configured to offer TLS 1.1 and 1.0 too.
While effective and maybe appropriate as a distribution patch, this change is probably not going to be merged here because I'm not sure it matches the intent of the code. Except that I don't think I really understand the intent of the code very well: what do "supported" or "min_supported" mean? (well, I can find a possible explanation if the "min_supported" is only used as a bound and not included in "all_supported", but overall I'm lost)
By the way, in
dtls_record.erl
, thesupported_protocol_versions
function uses?MIN_SUPPORTED_VERSIONS
but I would have expectedMIN_DATAGRAM_SUPPORTED_VERSIONS
instead based on the names. Similarly, I can't tell if it's a bug or a construct I don't understand.I saw this on OTP 25 but it is still the case in git master AFAICT.
Thanks
The text was updated successfully, but these errors were encountered: