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,
205205 self .__service_url = service_url
206206 self .__url = urlparse .urlparse (service_url )
207207
208- if self .__url .scheme not in ('http' ,):
208+ if self .__url .scheme not in ('http' , 'https' ):
209209 raise ValueError ('Unsupported URL scheme %r' % self .__url .scheme )
210210
211211 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
213216 else :
214217 port = self .__url .port
215218 self .__id_count = 0
@@ -223,8 +226,12 @@ def __init__(self,
223226 if connection :
224227 self .__conn = connection
225228 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 )
228235
229236 def _call (self , service_name , * args ):
230237 self .__id_count += 1
You can’t perform that action at this time.
0 commit comments