mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
On Windows use the operating system's native CA store for certificate verification of https requests.
- Updated included headers to support compilation on Windows (using Visual C++)
This commit is contained in:
parent
91a736692a
commit
ebf1f8fd28
@ -20,10 +20,14 @@
|
|||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
#else
|
||||||
|
#include <winsock2.h>
|
||||||
|
#endif
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
@ -94,6 +98,11 @@ bool HttpsClient::download(const std::string &uri) {
|
|||||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1);
|
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1);
|
||||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 1);
|
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 1);
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
/* use the operating system's native CA store for certificate verification.*/
|
||||||
|
curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, (long)CURLSSLOPT_NATIVE_CA);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* send all data to this function */
|
/* send all data to this function */
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &HttpsClient::handle);
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &HttpsClient::handle);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user