我有以下代码片段。以前它工作正常并且正在打印输出
但是现在当我在同一网络中更改我的机器的物理位置时,我得到error: [Errno 104] Connection reset by peer
错误 IP 与机器相同。
我正在使用 Scientific Linux 6.1
operation='GET'
url="/apifactory/api"
url_request = "%s HTTP/1.1" %url
connect = httplib.HTTPSConnection('myhost.com')
try:
connect.request(operation,url_request,'')
except Exception,obj:
connect.close()
print traceback.format_exc()
response_obj=connect.getresponse()
data=response_obj.read()
connect.close()
print data
Traceback:
File "/usr/local/lib/python2.7/ssl.py", line 121, in __init__
self.do_handshake()
File "/usr/local/lib/python2.7/ssl.py", line 281, in do_handshake
self._sslobj.do_handshake()
error: [Errno 104] Connection reset by peer
我试过 openssl s_client -connect myhost.com:443
它给出了:
CONNECTED(00000003)
write:errno=104
no peer certificate available
No client certificate CA names sent
SSL handshake has read 0 bytes and written 113 bytes
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
在更改位置之前一切正常。可能的原因是什么?关于 opesssl 配置或认证有什么变化吗?