1
mirror of https://github.com/mpv-player/mpv synced 2024-08-04 14:59:58 +02:00

network: add options to control TLS verification

This commit is contained in:
wm4 2013-09-27 18:07:53 +02:00
parent b8382aabb3
commit b7f01957ec
4 changed files with 17 additions and 0 deletions

View File

@ -2283,6 +2283,14 @@
is often a slow operation, and if the title changes every frame,
playback can be ruined.
``--tls-ca-file=<filename>``
Certificate authority database file for use with TLS. (Silently fails with
older ffmpeg or libav versions.)
``--tls-verify``
Verify peer certificates when using TLS (e.g. with ``https://...``).
(Silently fails with older ffmpeg or libav versions.)
``--tv=<option1:option2:...>``
This option tunes various properties of the TV capture module. For
watching TV with mpv, use ``tv://`` or ``tv://<channel_number>`` or

View File

@ -47,6 +47,8 @@ int network_cookies_enabled = 0;
char *network_useragent="mpv " VERSION;
char *network_referrer=NULL;
char **network_http_header_fields=NULL;
int network_tls_verify;
char *network_tls_ca_file;
extern char *lirc_configfile;
@ -388,6 +390,8 @@ const m_option_t mp_opts[] = {
{"udp", 1},
{"tcp", 2},
{"http", 3})),
{"tls-verify", &network_tls_verify, CONF_TYPE_FLAG, 0, 0, 0, NULL},
{"tls-ca-file", &network_tls_ca_file, CONF_TYPE_STRING, 0, 0, 0, NULL},
// ------------------------- demuxer options --------------------

View File

@ -281,6 +281,8 @@ extern char **network_http_header_fields;
extern char *network_useragent;
extern char *network_referrer;
extern int network_cookies_enabled;
extern int network_tls_verify;
extern char *network_tls_ca_file;
extern char *cookies_file;
extern const m_option_t mp_opts[];

View File

@ -179,6 +179,9 @@ static int open_f(stream_t *stream, int mode)
av_dict_set(&dict, "user-agent", network_useragent, 0);
if (network_cookies_enabled)
av_dict_set(&dict, "cookies", talloc_steal(temp, cookies_lavf()), 0);
av_dict_set(&dict, "tls_verify", network_tls_verify ? "1" : "0", 0);
if (network_tls_ca_file)
av_dict_set(&dict, "ca_file", network_tls_ca_file, 0);
char *cust_headers = talloc_strdup(temp, "");
if (network_referrer) {
cust_headers = talloc_asprintf_append(cust_headers, "Referer: %s\r\n",