Я использую httplib2 для открытия ssl-соединения. Ниже приведен код.
import httplib2
if __name__=='__main__':
conn = httplib2.Http(disable_ssl_certificate_validation=True)
conn.add_certificate('serverkey.pem', 'servercert.pem', '')
resp, content = conn.request(uri = 'https://xxx.xxx.xxx.xxx:xxxx/Konfigurator
/REST/login?userName=xxx&pass=xxx', method = 'POST')
print resp
это ошибка, которую я получаю.
Traceback (most recent call last):
File "C:\eclipse-workspace\REST\src\examples.py", line 7, in <module>
resp, content = conn.request(uri = 'https://xxx.xxx.xxx.xxx:xxx/Konfigurator/REST/login?userName=xxx&pass=xxx', method = 'POST')
File "C:\Python27\lib\site-packages\httplib2-0.7.1-py2.7.egg\httplib2\__init__.py", line 1437, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "C:\Python27\lib\site-packages\httplib2-0.7.1-py2.7.egg\httplib2\__init__.py", line 1189, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "C:\Python27\lib\site-packages\httplib2-0.7.1-py2.7.egg\httplib2\__init__.py", line 1163, in _conn_request
conn.connect()
File "C:\Python27\lib\site-packages\httplib2-0.7.1-py2.7.egg\httplib2\__init__.py", line 925, in connect
raise socket.error, msg
socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
Код правильный или я что-то здесь упускаю?