From eaf29d53e4df3ff8be9d78e84c7c556b01bf7034 Mon Sep 17 00:00:00 2001 From: df Date: Tue, 20 Jul 2021 19:17:48 +0100 Subject: [PATCH] Disable hopeless server certificate validation by test client --- test/test_clientcert.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/test_clientcert.py b/test/test_clientcert.py index e054e8129..db1f8af91 100644 --- a/test/test_clientcert.py +++ b/test/test_clientcert.py @@ -39,7 +39,11 @@ class TestClientCert(unittest.TestCase): def test_check_clientcertificate(self): clientcertfn = os.path.join(TEST_DIR, 'testdata', 'clientcert', 'client.crt') - ydl = YoutubeDL({'logger': FakeLogger(), 'clientcertificate': clientcertfn}) + ydl = YoutubeDL({'logger': FakeLogger(), 'clientcertificate': clientcertfn, + # Disable client-side validation of unacceptable self-signed testcert.pem + # The test is of a check on the server side, so unaffected + 'nocheckcertificate': True, + }) r = ydl.extract_info('https://127.0.0.1:%d/video.html' % self.port) self.assertEqual(r['entries'][0]['url'], 'https://127.0.0.1:%d/vid.mp4' % self.port)