diff options
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r-- | yt_dlp/utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py index 5c83b92b4..3f22eaf75 100644 --- a/yt_dlp/utils.py +++ b/yt_dlp/utils.py @@ -936,6 +936,14 @@ def make_HTTPS_handler(params, **kwargs): for storename in ('CA', 'ROOT'): _ssl_load_windows_store_certs(context, storename) context.set_default_verify_paths() + client_certfile = params.get('client_certificate') + if client_certfile: + try: + context.load_cert_chain( + client_certfile, keyfile=params.get('client_certificate_key'), + password=params.get('client_certificate_password')) + except ssl.SSLError: + raise YoutubeDLError('Unable to load client certificate') return YoutubeDLHTTPSHandler(params, context=context, **kwargs) |