mirror of
https://github.com/mpv-player/mpv
synced 2025-04-10 11:41:37 +00:00
options: add support for client certificate authentication
Client certificates are supported by ffmpeg as documented here: > https://www.ffmpeg.org/ffmpeg-protocols.html#tls Signed-off-by: wm4 <wm4@nowhere>
This commit is contained in:
parent
0121d00478
commit
1ee8ce75f1
@ -3278,6 +3278,13 @@ Network
|
|||||||
Verify peer certificates when using TLS (e.g. with ``https://...``).
|
Verify peer certificates when using TLS (e.g. with ``https://...``).
|
||||||
(Silently fails with older FFmpeg or Libav versions.)
|
(Silently fails with older FFmpeg or Libav versions.)
|
||||||
|
|
||||||
|
``--tls-cert-file``
|
||||||
|
A file containing a certificate to use in the handshake with the
|
||||||
|
peer.
|
||||||
|
|
||||||
|
``--tls-key-file``
|
||||||
|
A file containing the private key for the certificate.
|
||||||
|
|
||||||
``--referrer=<string>``
|
``--referrer=<string>``
|
||||||
Specify a referrer path or URL for HTTP requests.
|
Specify a referrer path or URL for HTTP requests.
|
||||||
|
|
||||||
|
@ -185,6 +185,8 @@ const m_option_t mp_opts[] = {
|
|||||||
{"http", 3})),
|
{"http", 3})),
|
||||||
OPT_FLAG("tls-verify", network_tls_verify, 0),
|
OPT_FLAG("tls-verify", network_tls_verify, 0),
|
||||||
OPT_STRING("tls-ca-file", network_tls_ca_file, M_OPT_FILE),
|
OPT_STRING("tls-ca-file", network_tls_ca_file, M_OPT_FILE),
|
||||||
|
OPT_STRING("tls-cert-file", network_tls_cert_file, M_OPT_FILE),
|
||||||
|
OPT_STRING("tls-key-file", network_tls_key_file, M_OPT_FILE),
|
||||||
OPT_DOUBLE("network-timeout", network_timeout, M_OPT_MIN, .min = 0),
|
OPT_DOUBLE("network-timeout", network_timeout, M_OPT_MIN, .min = 0),
|
||||||
|
|
||||||
// ------------------------- demuxer options --------------------
|
// ------------------------- demuxer options --------------------
|
||||||
|
@ -277,6 +277,8 @@ typedef struct MPOpts {
|
|||||||
char **network_http_header_fields;
|
char **network_http_header_fields;
|
||||||
int network_tls_verify;
|
int network_tls_verify;
|
||||||
char *network_tls_ca_file;
|
char *network_tls_ca_file;
|
||||||
|
char *network_tls_cert_file;
|
||||||
|
char *network_tls_key_file;
|
||||||
double network_timeout;
|
double network_timeout;
|
||||||
|
|
||||||
struct tv_params *tv_params;
|
struct tv_params *tv_params;
|
||||||
|
@ -168,6 +168,10 @@ void mp_setup_av_network_options(AVDictionary **dict, struct mpv_global *global,
|
|||||||
av_dict_set(dict, "tls_verify", opts->network_tls_verify ? "1" : "0", 0);
|
av_dict_set(dict, "tls_verify", opts->network_tls_verify ? "1" : "0", 0);
|
||||||
if (opts->network_tls_ca_file)
|
if (opts->network_tls_ca_file)
|
||||||
av_dict_set(dict, "ca_file", opts->network_tls_ca_file, 0);
|
av_dict_set(dict, "ca_file", opts->network_tls_ca_file, 0);
|
||||||
|
if (opts->network_tls_cert_file)
|
||||||
|
av_dict_set(dict, "cert_file", opts->network_tls_cert_file, 0);
|
||||||
|
if (opts->network_tls_key_file)
|
||||||
|
av_dict_set(dict, "key_file", opts->network_tls_key_file, 0);
|
||||||
char *cust_headers = talloc_strdup(temp, "");
|
char *cust_headers = talloc_strdup(temp, "");
|
||||||
if (opts->network_referrer) {
|
if (opts->network_referrer) {
|
||||||
cust_headers = talloc_asprintf_append(cust_headers, "Referer: %s\r\n",
|
cust_headers = talloc_asprintf_append(cust_headers, "Referer: %s\r\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user