@@ -56,6 +56,8 @@ int http_fetch_to_stream(const char * url, FILE * outputFile, bool verbose, bool
56
56
//curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
57
57
//curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2L);
58
58
59
+ ///////////////////////////////////////////////////////////////////////////////////
60
+
59
61
// https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_default_verify_paths.html
60
62
const char * const SSL_CERT_FILE = getenv ("SSL_CERT_FILE" );
61
63
@@ -64,13 +66,26 @@ int http_fetch_to_stream(const char * url, FILE * outputFile, bool verbose, bool
64
66
curl_easy_setopt (curl , CURLOPT_CAINFO , SSL_CERT_FILE );
65
67
}
66
68
69
+ ///////////////////////////////////////////////////////////////////////////////////
70
+
67
71
const char * const SSL_CERT_DIR = getenv ("SSL_CERT_DIR" );
68
72
69
73
if ((SSL_CERT_DIR != NULL ) && (SSL_CERT_DIR [0 ] != '\0' )) {
70
74
// https://curl.se/libcurl/c/CURLOPT_CAPATH.html
71
75
curl_easy_setopt (curl , CURLOPT_CAPATH , SSL_CERT_DIR );
72
76
}
73
77
78
+ ///////////////////////////////////////////////////////////////////////////////////
79
+
80
+ const char * const DNS_SERVERS = getenv ("CURLOPT_DNS_SERVERS" );
81
+
82
+ if ((DNS_SERVERS != NULL ) && (DNS_SERVERS [0 ] != '\0' )) {
83
+ // https://curl.se/libcurl/c/CURLOPT_DNS_SERVERS.html
84
+ curl_easy_setopt (curl , CURLOPT_DNS_SERVERS , DNS_SERVERS );
85
+ }
86
+
87
+ ///////////////////////////////////////////////////////////////////////////////////
88
+
74
89
char userAgent [50 ];
75
90
snprintf (userAgent , 50 , "User-Agent: libcurl-%s" , LIBCURL_VERSION );
76
91
0 commit comments