summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-09-10 14:31:20 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-13 07:42:28 +0100
commite0fb62596f1704a9656ff46231b9fac896ad13b2 (patch)
tree77d2463bbf3faaa605bce5dcaf46c047e4dc5a07 /meta/recipes-devtools/python/python3
parenta8948584c1bfec41611596fa24a984ae503e9375 (diff)
downloadpoky-e0fb62596f1704a9656ff46231b9fac896ad13b2.tar.gz
python3: fix ftplib with TLS 1.3
With OpenSSL 1.1.x TLS 1.3 can be used, so backport a patch from Python 3.6 to fix the ftplib unit test. (From OE-Core rev: a31047bec6b7c368674d4620e70e526ac211b936) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python/python3')
-rw-r--r--meta/recipes-devtools/python/python3/ftplib.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/ftplib.patch b/meta/recipes-devtools/python/python3/ftplib.patch
new file mode 100644
index 0000000000..8bb3cd0219
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/ftplib.patch
@@ -0,0 +1,57 @@
1From cabe916dc694997d4892b58986e73a713d5a2f8d Mon Sep 17 00:00:00 2001
2From: "Miss Islington (bot)"
3 <31488909+miss-islington@users.noreply.github.com>
4Date: Thu, 16 Aug 2018 15:38:03 -0400
5Subject: [PATCH] [3.6] bpo-34391: Fix ftplib test for TLS 1.3 (GH-8787)
6 (#8790)
7
8Read from data socket to avoid "[SSL] shutdown while in init" exception
9during shutdown of the dummy server.
10
11Signed-off-by: Christian Heimes <christian@python.org>
12
13
14<!-- issue-number: [bpo-34391](https://www.bugs.python.org/issue34391) -->
15https://bugs.python.org/issue34391
16<!-- /issue-number -->
17(cherry picked from commit 1590c393360df059160145e7475754427bfc6680)
18
19
20Co-authored-by: Christian Heimes <christian@python.org>
21---
22 Lib/test/test_ftplib.py | 5 +++++
23 Misc/NEWS.d/next/Tests/2018-08-16-18-48-47.bpo-34391.ouNfxC.rst | 1 +
24 2 files changed, 6 insertions(+)
25 create mode 100644 Misc/NEWS.d/next/Tests/2018-08-16-18-48-47.bpo-34391.ouNfxC.rst
26
27diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
28index 44dd73aeca..4ff2f71afb 100644
29--- a/Lib/test/test_ftplib.py
30+++ b/Lib/test/test_ftplib.py
31@@ -876,18 +876,23 @@ class TestTLS_FTPClass(TestCase):
32 # clear text
33 with self.client.transfercmd('list') as sock:
34 self.assertNotIsInstance(sock, ssl.SSLSocket)
35+ self.assertEqual(sock.recv(1024), LIST_DATA.encode('ascii'))
36 self.assertEqual(self.client.voidresp(), "226 transfer complete")
37
38 # secured, after PROT P
39 self.client.prot_p()
40 with self.client.transfercmd('list') as sock:
41 self.assertIsInstance(sock, ssl.SSLSocket)
42+ # consume from SSL socket to finalize handshake and avoid
43+ # "SSLError [SSL] shutdown while in init"
44+ self.assertEqual(sock.recv(1024), LIST_DATA.encode('ascii'))
45 self.assertEqual(self.client.voidresp(), "226 transfer complete")
46
47 # PROT C is issued, the connection must be in cleartext again
48 self.client.prot_c()
49 with self.client.transfercmd('list') as sock:
50 self.assertNotIsInstance(sock, ssl.SSLSocket)
51+ self.assertEqual(sock.recv(1024), LIST_DATA.encode('ascii'))
52 self.assertEqual(self.client.voidresp(), "226 transfer complete")
53
54 def test_login(self):
55--
562.11.0
57