File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 20
20
#include < curl/curl.h>
21
21
#endif
22
22
23
+ #ifndef WIN32
23
24
#include < sys/socket.h>
24
25
#include < sys/types.h>
25
26
#include < netinet/in.h>
26
27
#include < arpa/inet.h>
28
+ #else
29
+ #include < winsock2.h>
30
+ #endif
27
31
#include < string>
28
32
29
33
#include < fstream>
@@ -94,6 +98,11 @@ bool HttpsClient::download(const std::string &uri) {
94
98
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1 );
95
99
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 1 );
96
100
101
+ #ifdef WIN32
102
+ /* use the operating system's native CA store for certificate verification.*/
103
+ curl_easy_setopt (curl, CURLOPT_SSL_OPTIONS, (long )CURLSSLOPT_NATIVE_CA);
104
+ #endif
105
+
97
106
/* send all data to this function */
98
107
curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, &HttpsClient::handle);
99
108
You can’t perform that action at this time.
0 commit comments