-
Notifications
You must be signed in to change notification settings - Fork 528
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
Switching SSL_library_init with OPENSSL_init_ssl #333
Conversation
Can one of the admins verify this patch? |
OK to test |
While this change is a good one, the relevant check should not ever need to run on Debian machines since it provides pkg-config integration. Do you have pkg-config installed? what does "pkg-config -- cflags openssl" return? What exact ./configure parameters did you use to enable OpenSSL support in Squid? |
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 agree that some changes are needed here, but the proposed fix needs more work or, at the very least, an explanation/assurances that it cannot make things worse for some of the supported environments.
OpenSSL documentation says: If you are using OpenSSL 1.0.2 or below, then you would use SSL_library_init
. Could this change break Squid support for some older OpenSSL versions that are currently supported?
To avoid these complex questions/issues, perhaps we should use a less version-dependent function call here? And a function call actually used by Squid itself?
This will break OpenSSL < 1.1. Better to check for some other function like SSL_CTX_new(NULL) |
@@ -1331,7 +1331,7 @@ if test "x$with_openssl" = "xyes"; then | |||
AC_CHECK_LIB(crypto,[CRYPTO_new_ex_data],[LIBOPENSSL_LIBS="-lcrypto $LIBOPENSSL_LIBS"],[ | |||
AC_MSG_ERROR([library 'crypto' is required for OpenSSL]) | |||
],$LIBOPENSSL_LIBS) | |||
AC_CHECK_LIB(ssl,[SSL_library_init],[LIBOPENSSL_LIBS="-lssl $LIBOPENSSL_LIBS"],[ | |||
AC_CHECK_LIB(ssl,[OPENSSL_init_ssl],[LIBOPENSSL_LIBS="-lssl $LIBOPENSSL_LIBS"],[ |
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 expect we should continue with the existing SSL_library_init test as per the OpenSSL documentation for the v1.0.2 and prior library versions which might lack pkg-config integration. Newer libraries certainly should all be providing that better method of determining compiler and linker settings. |
The documentation I cited invites the opposite conclusion IMO -- ./configure should not be using SSL_library_init( ) because that function is version-dependent. Another reason not to use that function in a ./configure test is because the function is unused in modern Squids. The SSL_CTX_new() function that @neheb and I suggested does not suffer from these problems AFAICT. It may suffer from some other, unknown to me problems. I do not know why @aogriffiths ignored our suggestion.
The library does provide pkg-config configuration, but it may not be working in a specific build environment (for whatever reason, including the lack of pkg-config installation). If it were all working, this pull request would not exist. As long as we support a version-agnostic AC_CHECK_LIB() test, we should not rely on a version-specific function inside that test. Alternatively, we could drop support for environments without (working) pkg-config or even make the AC_CHECK_LIB() test version-specific, but all those controversial/complex alternatives are outside this simple PR scope (and can be implemented independently from this PR). |
Hi, Homebrew (https://github.com/Homebrew/homebrew-core) maintainer here. I can confirm that the current squid configure checks fail with OpenSSL 1.1.1c, because |
Closing in favor of #470 which has an active developer behind it and should solve the problem that this PR was working on. Thank you. |
As explained here tsiv/ccminer-cryptonight#25
Tested on Debian GNU/Linux 9 (stretch)