Skip to content

Commit d70dfa9

Browse files
committed
Get HTTPS working in http_client by skipping over a super.
The super() used in http.client.HTTPSConnection leads to a bit of recursion because of the already in place overrides. To get around this we replace the __init__. This unfortunately removes some SSL features, but on the other hand it means that SSL type requests will work. For more effective testing other libraries should be used.
1 parent e10b780 commit d70dfa9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

wsgi_intercept/http_client_intercept.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,16 @@ class HTTP_WSGIInterceptor(HTTPInterceptorMixin, http_lib.HTTPConnection):
3030

3131
class HTTPS_WSGIInterceptor(HTTPSInterceptorMixin, http_lib.HTTPSConnection,
3232
HTTP_WSGIInterceptor):
33-
pass
33+
34+
def __init__(self, host, **kwargs):
35+
self.host = host
36+
try:
37+
self.port = kwargs['port']
38+
except KeyError:
39+
self.port = None
40+
HTTP_WSGIInterceptor.__init__(self, host, **kwargs)
41+
42+
3443

3544

3645
def install():

0 commit comments

Comments
 (0)