options: enable tls-verify by default

We shouldn't default to no verification in current year. User can
opt-out if needed.

Keep it disable for builds without libcurl when libavformat is older
than 63.0.100. This is done to match ffmpeg's timeline for enabling
tls_verify by default in lavf, also to ensure we the default verify
locations will be loaded on such version.
This commit is contained in:
Kacper Michajłow
2026-05-11 22:53:26 +02:00
parent ca89a744c9
commit ee3d72ce02
3 changed files with 16 additions and 3 deletions
@@ -0,0 +1 @@
change `--tls-verify` default to `yes`
+10 -3
View File
@@ -5663,9 +5663,16 @@ Network
Certificate authority database file for use with TLS. (Silently fails with
older FFmpeg versions.)
``--tls-verify``
Verify peer certificates when using TLS (e.g. with ``https://...``).
(Silently fails with older FFmpeg versions.)
``--tls-verify=<yes|no>``
Verify peer certificates when using TLS (e.g. with ``https://...``)
(default: yes*). Disabling this option allows man-in-the-middle attacks
to silently substitute the content of an HTTPS stream and is only
recommended as a per-stream override when verification fails for a
known-good reason (e.g. an outdated CA bundle, a corporate proxy, a
development server with a self-signed certificate).
This is disabled by default, if mpv is built without libcurl and
libavformat is older than 63.0.100.
``--tls-cert-file``
A file containing a certificate to use in the handshake with the
+5
View File
@@ -17,6 +17,8 @@
#include <float.h>
#include <libavformat/version.h>
#include "network.h"
#include "options/m_option.h"
@@ -41,5 +43,8 @@ const struct m_sub_options mp_network_conf = {
.defaults = &(const struct mp_network_opts){
.useragent = "libmpv",
.timeout = 60,
#if HAVE_LIBCURL || LIBAVFORMAT_VERSION_MAJOR >= 63
.tls_verify = true,
#endif
},
};