我正在使用httplib2发出请求,我收到以下错误
[Errno 104] Connection reset by peer
这是我在我的代码中实现它的方式
import httplib2
timeout = 60
h = httplib2.Http(".cache", timeout=timeout, disable_ssl_certificate_validation=True)
h.request('https://somewebsite.com/some_xml_page.aspx', "GET")
connect fail: (somewebsite.com, 443)
connect fail: (somewebsite.com, 443)
error Traceback (most recent call last)
<ipython-input-7-c8b901c7fdfa> in <module>()
----> 1 h.request('https://somewebsite.com/some_xml_page.aspx', "GET")
/usr/lib/python2.7/dist-packages/httplib2/__init__.pyc in request(self, uri, method, body, headers, redirections, connection_type)
1594 content = ""
1595 else:
-> 1596 (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
1597 except Exception, e:
1598 if self.force_exception_to_status_code:
/usr/lib/python2.7/dist-packages/httplib2/__init__.pyc in _request(self, conn, host, absolute_uri, request_uri, method, body, headers, redirections, cachekey)
1342 auth.request(method, request_uri, headers, body)
1343
-> 1344 (response, content) = self._conn_request(conn, request_uri, method, body, headers)
1345
1346 if auth:
/usr/lib/python2.7/dist-packages/httplib2/__init__.pyc in _conn_request(self, conn, request_uri, method, body, headers)
1316 if i < RETRIES-1:
1317 conn.close()
-> 1318 conn.connect()
1319 continue
1320 else:
/usr/lib/python2.7/dist-packages/httplib2/__init__.pyc in connect(self)
1049 break
1050 if not self.sock:
-> 1051 raise socket.error, msg
1052
1053 SCHEME_TO_CONNECTION = {
error: [Errno 104] Connection reset by peer
我想要获取页面的服务器具有TSL 1.1 / 1.2,但它不支持SSL v3 SSL v2和TLS 1.0。
当我向
发出请求时,我的代码有效h.request('https://encrypted.google.com', "GET")
https://encrypted.google.com支持SSL v3。
如何从使用TLS 1.1 / 1.2协议且没有SSL v3,SSL v2和TLS 1.0的Web服务器获取页面。