Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(387)

Side by Side Diff: Lib/xmlrpc/client.py

Issue 9991: xmlrpc client ssl check faulty
Patch Set: Created 2 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_xmlrpc.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # 1 #
2 # XML-RPC CLIENT LIBRARY 2 # XML-RPC CLIENT LIBRARY
3 # $Id$ 3 # $Id$
4 # 4 #
5 # an XML-RPC client interface for Python. 5 # an XML-RPC client interface for Python.
6 # 6 #
7 # the marshalling and response parser code can also be used to 7 # the marshalling and response parser code can also be used to
8 # implement XML-RPC servers. 8 # implement XML-RPC servers.
9 # 9 #
10 # Notes: 10 # Notes:
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 1323
1324 class SafeTransport(Transport): 1324 class SafeTransport(Transport):
1325 """Handles an HTTPS transaction to an XML-RPC server.""" 1325 """Handles an HTTPS transaction to an XML-RPC server."""
1326 1326
1327 # FIXME: mostly untested 1327 # FIXME: mostly untested
1328 1328
1329 def make_connection(self, host): 1329 def make_connection(self, host):
1330 if self._connection and host == self._connection[0]: 1330 if self._connection and host == self._connection[0]:
1331 return self._connection[1] 1331 return self._connection[1]
1332 1332
1333 if not hasattr(socket, "ssl"): 1333 if not hasattr(http.client, "HTTPSConnection"):
1334 raise NotImplementedError( 1334 raise NotImplementedError(
1335 "your version of http.client doesn't support HTTPS") 1335 "your version of http.client doesn't support HTTPS")
1336 # create a HTTPS connection object from a host descriptor 1336 # create a HTTPS connection object from a host descriptor
1337 # host may be a string, or a (host, x509-dict) tuple 1337 # host may be a string, or a (host, x509-dict) tuple
1338 chost, self._extra_headers, x509 = self.get_host_info(host) 1338 chost, self._extra_headers, x509 = self.get_host_info(host)
1339 self._connection = host, http.client.HTTPSConnection(chost, 1339 self._connection = host, http.client.HTTPSConnection(chost,
1340 None, **(x509 or {})) 1340 None, **(x509 or {}))
1341 return self._connection[1] 1341 return self._connection[1]
1342 1342
1343 ## 1343 ##
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 1470
1471 # The server at xmlrpc.com doesn't seem to support multicall anymore. 1471 # The server at xmlrpc.com doesn't seem to support multicall anymore.
1472 multi = MultiCall(server) 1472 multi = MultiCall(server)
1473 multi.currentTime.getCurrentTime() 1473 multi.currentTime.getCurrentTime()
1474 multi.currentTime.getCurrentTime() 1474 multi.currentTime.getCurrentTime()
1475 try: 1475 try:
1476 for response in multi(): 1476 for response in multi():
1477 print(response) 1477 print(response)
1478 except Error as v: 1478 except Error as v:
1479 print("ERROR", v) 1479 print("ERROR", v)
OLDNEW
« no previous file with comments | « Lib/test/test_xmlrpc.py ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7