Disallow unsupported options for TLSv1.3#324
Disallow unsupported options for TLSv1.3#324Maria-12648430 wants to merge 1 commit intoninenines:masterfrom
Conversation
|
... and something is wrong with the Alpine agent I guess? 🙄 |
|
Wait a minute... I just checked the OTP There are options that are allowed for TLSv1.3 only (naturally). We could go all the way and filter them out the same way if TLSv1.3 is not among the protocols to be used, but that may be dangerous? It could lead to a user accidentially relying on TLSv1.3 features which are then not used, and dropped with only a warning, I mean? @essen, what do you think? In any case, further research is needed. |
|
Yes There are also some ciphers that work with TLS1.2 but not 1.3 and vice versa if I recall. So yes definitely needs some research. |
|
And there is other stuff that works only in conjunction with yet other stuff, or needs to be set to this-and-that when some-and-such is set to whatever... |
|
https://rabbitmq.com/ssl.html#tls1.3 might help. I think it's OK if bad combinations are not detected. We should only focus on options no longer working because they were explicitly removed from the TLS 1.3 spec. https://datatracker.ietf.org/doc/html/rfc8446#section-1.2 So that's NPN is not explicitly stated but it was replaced by ALPN many years ago and the spec only mentions ALPN so if it doesn't work with TLS 1.3 that's why. A test for each of these can be written like this: try the option with plain ssl, confirm the option doesn't work (can't listen), then setup Ranch with that option and confirm Ranch still inits properly and can be connected to. |
|
The options unsupported by TLSv1.3 that are checked by
|
|
OK I don't think we need to block |
No idea. I just grepped this from the |
|
Sounds like it's all fine for the server but would need some special handling in Gun for the OK so we can just block everything then on the list minus |
818612d to
9290ce9
Compare
|
Ok, updated. What do you think? I'm not fully satisfied with the version/support check, I'll try to think of something better :) But you can take a look already ;) |
|
I don't know what's wrong with the tests but otherwise I'm OK with the PR. |
The problem is the check that usage of non-TLSv1.3 options fail when used in "plain" ssl, but that does not happen (ie, they are accepted) in OTP <23. I'm at it.
I have some improvements coming up, will explain more when pushed. |
9290ce9 to
16bfed2
Compare
|
Ok, last commit skips the test if Also, I improved the matching on the protocol version(s). They are |
* beast_mitigation * client_renegotiation * next_protocols_advertised * padding_check * psk_identity * reuse_session * reuse_sessions * secure_renegotiate * user_lookup_fun
16bfed2 to
b7ac340
Compare
|
Merged, thanks! |
|
Progress 🤩 |
When
'tlsv1.3'is the only protocol version (either in theversionskey in given socket options, in theprotocol_versionkey in thesslapplication environment, or in thesupportedkey in the list returned fromssl:versions/0, whichever is set first, in that order), the following options are additionally disallowed:alpn_preferred_protocolsnext_protocols_advertisedreuse_sessionssecure_renegotiateHowever, I have no idea how this could be tested 😓.