Fix remote resources download while hosting SSL site on Apache

As reported by Christian Folin and Walter Hop on our dev mailing list, Apache
mod_ssl was failing if a remote resource was utilized. That was happening
because Curl clean up was also cleaning up the OpenSSL data used by mod_ssl.
This patch moves Curl initialization to happens while ModSecurity is
initialized.
This commit is contained in:
Felipe Zimmerle
2014-11-27 08:36:32 -08:00
parent 23823bb2c3
commit 87a401af05
3 changed files with 19 additions and 2 deletions

View File

@@ -258,7 +258,6 @@ int msc_remote_download_content(apr_pool_t *mp, const char *uri, const char *key
apr_id = apr_psprintf(mp, "ModSec-unique-id: %s", id);
curl_global_init(CURL_GLOBAL_ALL);
curl = curl_easy_init();
beacon_str_len = msc_beacon_string(NULL, 0);
@@ -348,7 +347,6 @@ int msc_remote_download_content(apr_pool_t *mp, const char *uri, const char *key
curl_easy_cleanup(curl);
curl_global_cleanup();
return 0;
#else
return -3;