question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[SSL: DH_KEY_TOO_SMALL] dh key too small

See original GitHub issue

Checklist

  • I’m reporting a broken site support issue
  • I’ve verified that I’m running youtube-dl version 2020.03.24
  • I’ve checked that all provided URLs are alive and playable in a browser
  • I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
  • I’ve searched the bugtracker for similar bug reports including closed ones
  • I’ve read bugs section in FAQ

Verbose log

youtube-dl --verbose https://www.ceskatelevize.cz/porady/11571031751-anatomie-zrady/219512120010001/
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', 'https://www.ceskatelevize.cz/porady/11571031751-anatomie-zrady/219512120010001/']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2020.03.24
[debug] Python version 3.8.2 (CPython) - Linux-5.4.0-26-generic-x86_64-with-glibc2.29
[debug] exe versions: ffmpeg 4.2.2, ffprobe 4.2.2, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[CeskaTelevizePorady] 219512120010001: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1108)> (caused by URLError(SSLError(1, '[SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1108)')))
  File "/home/xzdse/.local/lib/python3.8/site-packages/youtube_dl/extractor/common.py", line 627, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/home/xzdse/.local/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 2238, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/home/xzdse/.local/lib/python3.8/site-packages/youtube_dl/utils.py", line 2726, in https_open
    return self.do_open(functools.partial(
  File "/usr/lib/python3.8/urllib/request.py", line 1322, in do_open
    raise URLError(err)

Description

This should be already fixed in #22335 but I came back after upgrading Ubuntu 19.10 to 20.04. I tested Youtube to verify but it seems to be related to this site only. Since this issue is not present when browsing the site, there must be a way to to convince youtube-dl to accept weak DH keys.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

5reactions
zenMayacommented, Jan 16, 2021

Hi, the easiest, non destructive way is what @webdevelopers-eu suggested, but I will just provide a simple script as solution for this problem (temporary)

#!/bin/bash
cat <<EOF > ssl_conf
openssl_conf = default_conf

[ default_conf ]

ssl_conf = ssl_sect

[ssl_sect]

system_default = system_default_sect

[system_default_sect]
MinProtocol = TLSv1.2
CipherString = DEFAULT:@SECLEVEL=1
EOF

export OPENSSL_CONF="$(pwd)/ssl_conf"

youtube-dl "$@"
2reactions
xmstspidercommented, Apr 30, 2020

The temporary workaround for me was to edit /etc/ssl/openssl.cnf and comment out CipherString = DEFAULT@SECLEVEL=2

Hmm I don’t have this line in my Ubuntu 20.04

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python - requests.exceptions.SSLError - dh key too small
I had the following error: SSLError: [SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.
Read more >
[SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1108 ...
I experienced this error after upgrading from 18.04 LTS to 20.04 LTS, whilst trying to connect to an Exchange server.
Read more >
ssl.SSLError: [SSL: DH_KEY_TOO_SMALL] dh key too small ...
If you have control over the server (or can contact those who do) then ideally the solution would be to configure the server...
Read more >
What does the "dh key too small" SSL error means?
This error means your SSL setup is vulnerable because it supports small DH keys, and this is getting rejected by "recent" versions of...
Read more >
dh key too small - IMLC.ME
Today I encoutered the dh key too small issue when running curl and wget commands. And most of the reasons is that server...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found