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
THRIFT-5706: lib: cpp: Fix C++ SecurityTest compilation on OpenSSL1.x #2811
base: master
Are you sure you want to change the base?
Conversation
A recent change modified SecurityTest.cpp/SecurityFromBufferTest.cpp to handle OpenSSL3 by using OPENSSL_VERSION_MAJOR to detect the different OpenSSL versions. OPENSSL_VERSION_MAJOR is not available on OpenSSL 1.x, so these tests no longer compile on Ubuntu 20, etc. The underlying reason for the OpenSSL3 change is that older versions of TLS (1.0, 1.1) are only accessible when specifying @SECLEVEL=0. Some distributions with OpenSSL 1.1.1 (Ubuntu 20) make them accessible at @SECLEVEL=1, so the tests can also fail in that circumstance. This removes the reference to OPENSSL_VERSION_MAJOR and changes the test to specify @SECLEVEL=0 for OpenSSL versions that have @SECLEVEL support (> 1.1.0). Testing: - Tested SecurityTest/SecurityFromBufferTest on Ubuntu 20 and 22 - Tested with OpenSSL 1.0.2
@joemcdonnell can you check if this issue persists with latest thrift master? I think I fixed it, without seeing your PR before. But I did not check the details, so I may be wrong. I can say that my thrift build works with openSSL 1.x. But I may be using different options than you are. Kindly help and clarify? |
This PR fixes the Security tests to build on a clean install of ubuntu 20.04 and ubuntu 22.04 without modifications to the systems openssl configuration. * Enable TLS 1.0 and TLS 1.1 on OpenSSL 1.1 with the seclevel=0 flag * Disable TLS 1.0 and TLS 1.1 on OpenSSL 3.0 While its technically possible to enable it on OpenSSL 3 I think because of all the issues with these old TLS versions dropping support for it is better. This PR builds forth on the work done here: apache#2811
This PR fixes the Security tests to build on a clean install of ubuntu 20.04 and ubuntu 22.04 without modifications to the systems openssl configuration. * Enable TLS 1.0 and TLS 1.1 on OpenSSL 1.1 with the seclevel=0 flag * Disable TLS 1.0 and TLS 1.1 on OpenSSL 3.0 While its technically possible to enable it on OpenSSL 3 I think because of all the issues with these old TLS versions dropping support for it is better. This PR builds forth on the work done here: apache#2811
This PR fixes the Security tests to build on a clean install of ubuntu 20.04 and ubuntu 22.04 without modifications to the systems openssl configuration. * Enable TLS 1.0 and TLS 1.1 on OpenSSL 1.1 with the seclevel=0 flag * Disable TLS 1.0 and TLS 1.1 on OpenSSL 3.0 While its technically possible to enable it on OpenSSL 3 I think because of all the issues with these old TLS versions dropping support for it is better. This PR builds forth on the work done here: apache#2811
This PR fixes the Security tests to build on a clean install of ubuntu 20.04 and ubuntu 22.04 without modifications to the systems openssl configuration. * Enable TLS 1.0 and TLS 1.1 on OpenSSL 1.1 with the seclevel=0 flag * Disable TLS 1.0 and TLS 1.1 on OpenSSL 3.0 While its technically possible to enable it on OpenSSL 3 I think because of all the issues with these old TLS versions dropping support for it is better. This PR builds forth on the work done here: apache#2811
This PR fixes the Security tests to build on a clean install of ubuntu 20.04 and ubuntu 22.04 without modifications to the systems openssl configuration. * Enable TLS 1.0 and TLS 1.1 on OpenSSL 1.1 with the seclevel=0 flag * Disable TLS 1.0 and TLS 1.1 on OpenSSL 3.0 While its technically possible to enable it on OpenSSL 3 I think because of all the issues with these old TLS versions dropping support for it is better. This PR builds forth on the work done here: apache#2811 Tested with the ubuntu 20.04 (OpenSSL 1.1) and 22.04 (OpenSSL 3.0) docker containers. All lib/cpp tests succeed in both.
This PR fixes the Security tests to build on a clean install of ubuntu 20.04 and ubuntu 22.04 without modifications to the systems openssl configuration. * Enable TLS 1.0 and TLS 1.1 on OpenSSL 1.1 with the seclevel=0 flag * Disable TLS 1.0 and TLS 1.1 on OpenSSL 3.0 While its technically possible to enable it on OpenSSL 3 I think because of all the issues with these old TLS versions dropping support for it is better. This PR builds forth on the work done here: apache#2811 Tested with the ubuntu 20.04 (OpenSSL 1.1) and 22.04 (OpenSSL 3.0) docker containers. All lib/cpp tests succeed in both.
This PR fixes the Security tests to build on a clean install of ubuntu 20.04 and ubuntu 22.04 without modifications to the systems openssl configuration. * Enable TLS 1.0 and TLS 1.1 on OpenSSL 1.1 with the seclevel=0 flag * Disable TLS 1.0 and TLS 1.1 on OpenSSL 3.0 While its technically possible to enable it on OpenSSL 3 I think because of all the issues with these old TLS versions dropping support for it is better. This PR builds forth on the work done here: apache#2811 Tested with the ubuntu 20.04 (OpenSSL 1.1) and 22.04 (OpenSSL 3.0) docker containers. All lib/cpp tests succeed in both.
@emmenlau This issue is still affecting the latest master test run on a clean ubuntu 20.04 and 22.04. I can confirm that this PR also fixes the test issue so if you want to keep TLS1.0 and TLS1.1 tests enabled on OpenSSL 3.0 merging this PR and closing mine is also ok. |
This PR fixes the Security tests to build on a clean install of ubuntu 20.04 and ubuntu 22.04 without modifications to the systems openssl configuration. * Enable TLS 1.0 and TLS 1.1 on OpenSSL 1.1 with the seclevel=0 flag * Disable TLS 1.0 and TLS 1.1 on OpenSSL 3.0 While its technically possible to enable it on OpenSSL 3 I think because of all the issues with these old TLS versions dropping support for it is better. This PR builds forth on the work done here: apache#2811 Tested with the ubuntu 20.04 (OpenSSL 1.1) and 22.04 (OpenSSL 3.0) docker containers. All lib/cpp tests succeed in both.
This PR fixes the Security tests to build on a clean install of ubuntu 20.04 and ubuntu 22.04 without modifications to the systems openssl configuration. * Enable TLS 1.0 and TLS 1.1 on OpenSSL 1.1 with the seclevel=0 flag * Disable TLS 1.0 and TLS 1.1 on OpenSSL 3.0 While its technically possible to enable it on OpenSSL 3 I think because of all the issues with these old TLS versions dropping support for it is better. This PR builds forth on the work done here: apache#2811 Tested with the ubuntu 20.04 (OpenSSL 1.1) and 22.04 (OpenSSL 3.0) docker containers. All lib/cpp tests succeed in both.
Thanks a lot @thomasbruggink , I think your work here is very valid and I would consider this the correct way forward. However, making backwards-incompatible changes is always hard in wide-spread projects like thrift. Therefore I have a slight preference to combine this work here with your changes suggested in #2940, so that the old SSL/TLS versions continue to be supported. Could you kindly combine the work into a single PR here, and fix the minor conflicts? Then ping me again, and I'll try to merge it ASAP! |
@emmenlau any concern if we merge this or my PR? I think at this point the implementation is the same. |
A recent change modified SecurityTest.cpp/SecurityFromBufferTest.cpp to handle OpenSSL3 by using OPENSSL_VERSION_MAJOR to detect the different OpenSSL versions. OPENSSL_VERSION_MAJOR is not available on OpenSSL 1.x, so these tests no longer compile on Ubuntu 20, etc.
The underlying reason for the OpenSSL3 change is that older versions of TLS (1.0, 1.1) are only accessible when specifying @SECLEVEL=0. Some distributions with OpenSSL 1.1.1 (Ubuntu 20) make them accessible at @SECLEVEL=1, so the tests can also fail in that circumstance.
This removes the reference to OPENSSL_VERSION_MAJOR and changes the test to specify @SECLEVEL=0 for OpenSSL versions that have @SECLEVEL support (> 1.1.0).
Testing:
This fixes the build/functionality for SecurityTest/SecurityFromBufferTest after the changes in 05604e2
[skip ci]
anywhere in the commit message to free up build resources.