From b45df84357949c3558936b2b7aa7022721a8f8db Mon Sep 17 00:00:00 2001 From: Cesar Hoyos Date: Fri, 20 Dec 2019 12:14:16 +0100 Subject: [PATCH] On SSLObject.write method, added assert that data has content. This avoid to rise ssl.SSLEOFError on petition that has no content on response. --- Lib/ssl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/ssl.py b/Lib/ssl.py index 0726caee49a..54c6f9abdf0 100644 --- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -894,7 +894,10 @@ class SSLObject: The 'data' argument must support the buffer interface. """ - return self._sslobj.write(data) + if data != b'': + return self._sslobj.write(data) + else: + return "" def getpeercert(self, binary_form=False): """Returns a formatted version of the data in the certificate provided