mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
mlogc: Checks if curl supports CURL_SSLVERSION_TLSv1_2 before use it
Seems like curl versions older than 7.34.0 does not have support for `CURL_SSLVERSION_TLSv1_2'. In this cases, using CURL_SSLVERSION_TLSv1 which was added at version 7.9.2. ModSecurity demands a curl version newer than 7.15.1.
This commit is contained in:
@@ -1218,8 +1218,14 @@ static void logc_init(void)
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
/* Seems like CURL_SSLVERSION_TLSv1_2 is not supported on libcurl
|
||||
* < v7.34.0
|
||||
*/
|
||||
#ifdef WITH_CURL_SSLVERSION_TLSv1_2
|
||||
curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
|
||||
|
||||
#else
|
||||
curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
|
||||
#endif
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 15);
|
||||
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, TRUE);
|
||||
curl_easy_setopt(curl, CURLOPT_HEADER, TRUE);
|
||||
|
Reference in New Issue
Block a user