diff --git a/src/conffile.c b/src/conffile.c index d41710e0..17e39c22 100644 --- a/src/conffile.c +++ b/src/conffile.c @@ -69,6 +69,7 @@ static cfg_opt_t sec_general[] = CFG_INT("db_pragma_synchronous", -1, CFGF_NONE), CFG_STR("allow_origin", "*", CFGF_NONE), CFG_STR("user_agent", PACKAGE_NAME "/" PACKAGE_VERSION, CFGF_NONE), + CFG_BOOL("ssl_verifypeer", cfg_true, CFGF_NONE), CFG_BOOL("timer_test", cfg_false, CFGF_NONE), CFG_END() }; diff --git a/src/http.c b/src/http.c index 3084e642..2b7921c9 100644 --- a/src/http.c +++ b/src/http.c @@ -102,6 +102,7 @@ http_client_request(struct http_client_ctx *ctx) struct curl_slist *headers; struct onekeyval *okv; const char *user_agent; + long verifypeer; char header[1024]; long response_code; @@ -116,6 +117,9 @@ http_client_request(struct http_client_ctx *ctx) curl_easy_setopt(curl, CURLOPT_USERAGENT, user_agent); curl_easy_setopt(curl, CURLOPT_URL, ctx->url); + verifypeer = cfg_getbool(cfg_getsec(cfg, "general"), "ssl_verifypeer"); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, verifypeer); + headers = NULL; if (ctx->output_headers) {