File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -205,11 +205,14 @@ def __init__(self,
205
205
self .__service_url = service_url
206
206
self .__url = urlparse .urlparse (service_url )
207
207
208
- if self .__url .scheme not in ('http' ,):
208
+ if self .__url .scheme not in ('http' , 'https' ):
209
209
raise ValueError ('Unsupported URL scheme %r' % self .__url .scheme )
210
210
211
211
if self .__url .port is None :
212
- port = httplib .HTTP_PORT
212
+ if self .__url .scheme == 'https' :
213
+ port = httplib .HTTPS_PORT
214
+ else :
215
+ port = httplib .HTTP_PORT
213
216
else :
214
217
port = self .__url .port
215
218
self .__id_count = 0
@@ -223,8 +226,12 @@ def __init__(self,
223
226
if connection :
224
227
self .__conn = connection
225
228
else :
226
- self .__conn = httplib .HTTPConnection (self .__url .hostname , port = port ,
227
- timeout = timeout )
229
+ if self .__url .scheme == 'https' :
230
+ self .__conn = httplib .HTTPSConnection (self .__url .hostname , port = port ,
231
+ timeout = timeout )
232
+ else :
233
+ self .__conn = httplib .HTTPConnection (self .__url .hostname , port = port ,
234
+ timeout = timeout )
228
235
229
236
def _call (self , service_name , * args ):
230
237
self .__id_count += 1
You can’t perform that action at this time.
0 commit comments