File osc-ssl-fix-hang-at-server-hello.patch of Package osc

From: Sebastian Parschauer <sparschauer@suse.de>
Date: Tue, 31 Jul 2018 18:13:37 +0200
Subject: SSL: Fix hang at server hello
References: boo#1068470
Patch-mainline: No, custom hack

An SSL_shutdown() is required to close the connection once a file is
downloaded from https://api.opensuse.org. Otherwise resets (RST) are
visible in the tcpdump and it is possible that "osc co" hangs in
receiving the server hello as the client hello is continuously
repeated. This is timing related.

So add the missing close() method to class myHTTPSConnection and call
self.sock.close() in there which comes down to SSL_shutdown().
---
 osc/oscssl.py |    4 ++++
 1 file changed, 4 insertions(+)

--- a/osc/oscssl.py
+++ b/osc/oscssl.py
@@ -300,6 +300,10 @@ class myHTTPSConnection(M2Crypto.httpsli
     def getPort(self):
         return self.port
 
+    # boo#1068470 - sparschauer hack
+    def close(self):
+        self.sock.close()
+
 class myProxyHTTPSConnection(M2Crypto.httpslib.ProxyHTTPSConnection, HTTPSConnection):
     def __init__(self, *args, **kwargs):
         self.appname = kwargs.pop('appname', 'generic')
openSUSE Build Service is sponsored by