-
Notifications
You must be signed in to change notification settings - Fork 582
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
Disable TLS renegotiation and fix compile error on OpenBSD #9943
Conversation
ok with me! |
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 have absolutely no clue about OpenBSD, but how do you turn off tls renegotiation then?
That's the neat part, you don't! It's already the default. https://github.com/libressl/portable/blob/68ad61fd6d199607af327188c2dad0779f98fa46/ChangeLog#L2316-L2318 |
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.
🤷
a73b724
to
1b3be52
Compare
Actually, despite what I thought, v2.14.0 from ports allows renegotiation by default:
However with
under patches/:
|
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 have successfully built Icing 2 on OpenBSD through ports via replacing patches/patch-lib_base_tlsutility_cpp
by an adequately formatted version of this PR.
Index: lib/base/tlsutility.cpp
--- lib/base/tlsutility.cpp.orig
+++ lib/base/tlsutility.cpp
@@ -93,7 +93,9 @@ static void InitSslContext(const Shared<boost::asio::s
flags |= SSL_OP_CIPHER_SERVER_PREFERENCE;
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#ifdef LIBRESSL_VERSION_NUMBER
+ flags |= SSL_OP_NO_CLIENT_RENEGOTIATION;
+#elif OPENSSL_VERSION_NUMBER < 0x10100000L
SSL_CTX_set_info_callback(sslContext, [](const SSL* ssl, int where, int) {
if (where & SSL_CB_HANDSHAKE_DONE) {
ssl->s3->flags |= SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS;
So this PR should work and for future Icinga 2 releases this patch can be removed from the OpenBSD ports. The other diff in the original patch was already merged in #9882. (CC: @sthen)
For the future, we should find a Linux distribution that allows us to build Icinga 2 with LibreSSL via the CI. I will to create an issue.
Why not just guard it behind Cc @botovq, do you have opinions on this? |
Rather SSL_OP_NO_RENEGOTIATION and fall back to SSL_OP_NO_CLIENT_RENEGOTIATION, but yes – you have a point. |
This would add the assumption that OpenSSL will never ever introduce a macro with the same name (and if they did, there would be the question if in a compatible way or in a way that might break the code silently). So I'm not immediately convinced that this is actually a good idea. |
As both OpenSSL's However, @julianbrost has a valid point and OpenSSL is our main target1. Thus, I would keep the PR as it is with a comparison against Footnotes
|
Anyone who wants to make an argument for using If not, @Al2Klimov can you please rebase the PR so that it runs the latest actions? It changes code that does a version distinction on OpenSSL and there's a wide range of versions, so also running it on the newer distros sounds like a good idea to me. |
1b3be52
to
e1a4390
Compare
@sthen Ok?