https://issues.apache.org/bugzilla/show_bug.cgi?id=53952

--- Comment #37 from Christopher Schultz <ch...@christopherschultz.net> ---
I'm looking at Marcel's attachment #30150 and the protocol selection is a bit
verbose though methodical.

It took a bit of thinking to understand why the code does what it does.
Specifically, it does not explicitly cover all possible combinations of values
for "protocol". Instead, it takes a top-down approach assuming that the user
will want the highest-available protocol to be supported.

Checks for exact matches are performed for TLSv1.2, TLSv1.1, TLSv1(.0), SSLv3,
and SSLv2 are performed and the client gets the requested version unless the
library doesn't support that version, in which case the client gets an inert
SSL engine. It's debatable whether or not this should throw some kind of error.

After the exact checks, there are checks for "anything including TLSv1.2" and
"anything including TLSv1.1", except that those checks are not even compiled if
OpenSSL does not support them. (Of those, the highest protocol supported by the
library is used.)

Failing the above, SSL2/3 is selected.

I see a consistency problem, here: if TLSv1.2 is not supported by OpenSSL but
the client requests is specifically, then they will get an inert engine. If the
client requests TLSv1.2 + SSLv3 and TLSv1.2 is not supported, they'll get the
SSLv2/3 engine instead instead of the SSLv3 engine. It's not clear to me
whether this was intentional.

I will be committing attachment #30150 without modification and we can debate
the correct behavior later.

What's interesting (or awful: you decide) about OpenSSL is that you can't
choose the exact set of protocols to support when choosing an engine method.
Instead, you have to choose the engine method that makes the most sense
(usually the highest version-number that is supported and requested by the
client) and then you have to go back and black-list all the protocols that the
selected method may support but that you don't want. A perfect case is that of
requesting TLS1.2+TLS1.1 and nothing else. For that, you have to ask for the
TLSv1.2 method in OpenSSL, but that method also provides TLS1, SSLv3, and
SSLv2. So you have to call SSL_CTX_set_options and *enable* the *disable flags*
for those other protocols. It's not straightforward at all and worth mentioning
this to those who would like to review the patch.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to