Add cacert option for Curl plugin. Allows to set cacert for curl lib (#3)
Add cacert option for curl plugin add cacert option for Curl plugin. Allows to set cacert for curl lib Added documentation line into doc/plugins.rst with explanation for cacert option
This commit is contained in:
parent
3456b1e50d
commit
f5460b35a3
|
@ -210,6 +210,8 @@ will be in effect.
|
||||||
- Verify the peer's SSL certificate? `More information <http://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYPEER.html>`_.
|
- Verify the peer's SSL certificate? `More information <http://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYPEER.html>`_.
|
||||||
* - **verify_host yes|no**
|
* - **verify_host yes|no**
|
||||||
- Verify the certificate's name against host? `More information <http://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYHOST.html>`_.
|
- Verify the certificate's name against host? `More information <http://curl.haxx.se/libcurl/c/CURLOPT_SSL_VERIFYHOST.html>`_.
|
||||||
|
* - **cacert**
|
||||||
|
- Set path to Certificate Authority (CA) bundle `More information <https://curl.se/libcurl/c/CURLOPT_CAINFO.html>`_.
|
||||||
|
|
||||||
ffmpeg
|
ffmpeg
|
||||||
------
|
------
|
||||||
|
|
|
@ -148,6 +148,8 @@ static struct curl_slist *http_200_aliases;
|
||||||
/** HTTP proxy settings */
|
/** HTTP proxy settings */
|
||||||
static const char *proxy, *proxy_user, *proxy_password;
|
static const char *proxy, *proxy_user, *proxy_password;
|
||||||
static unsigned proxy_port;
|
static unsigned proxy_port;
|
||||||
|
/** CA CERT settings*/
|
||||||
|
static const char *cacert;
|
||||||
|
|
||||||
static bool verify_peer, verify_host;
|
static bool verify_peer, verify_host;
|
||||||
|
|
||||||
|
@ -375,7 +377,7 @@ input_curl_init(EventLoop &event_loop, const ConfigBlock &block)
|
||||||
#else
|
#else
|
||||||
constexpr bool default_verify = true;
|
constexpr bool default_verify = true;
|
||||||
#endif
|
#endif
|
||||||
|
cacert = block.GetBlockValue("cacert");
|
||||||
verify_peer = block.GetBlockValue("verify_peer", default_verify);
|
verify_peer = block.GetBlockValue("verify_peer", default_verify);
|
||||||
verify_host = block.GetBlockValue("verify_host", default_verify);
|
verify_host = block.GetBlockValue("verify_host", default_verify);
|
||||||
}
|
}
|
||||||
|
@ -432,6 +434,8 @@ CurlInputStream::InitEasy()
|
||||||
StringFormat<1024>("%s:%s", proxy_user,
|
StringFormat<1024>("%s:%s", proxy_user,
|
||||||
proxy_password).c_str());
|
proxy_password).c_str());
|
||||||
|
|
||||||
|
if (cacert != nullptr)
|
||||||
|
request->SetOption(CURLOPT_CAINFO, cacert);
|
||||||
request->SetVerifyPeer(verify_peer);
|
request->SetVerifyPeer(verify_peer);
|
||||||
request->SetVerifyHost(verify_host);
|
request->SetVerifyHost(verify_host);
|
||||||
request->SetOption(CURLOPT_HTTPHEADER, request_headers.Get());
|
request->SetOption(CURLOPT_HTTPHEADER, request_headers.Get());
|
||||||
|
|
Loading…
Reference in New Issue