mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-28 16:15:57 -05:00
Merge pull request #1370 from whatdoineed2do/http-optional-sslpeerverify
[http,conf] allow user to request no ssl peer verification
This commit is contained in:
commit
6ee2302133
@ -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()
|
||||
};
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user