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:
Felipe Zimmerle
2014-11-03 14:01:05 -08:00
parent 54bf71f8bd
commit 2615a5dfc8
2 changed files with 11 additions and 1 deletions

View File

@@ -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);