私は次の機能を持っています:
def soap(self, xml):
""" Transport function """
slash = self.apiurl.find('/')
addr = self.apiurl[:slash]
path = self.apiurl[slash:]
conn = httplib.HTTPSConnection(addr)
conn.putrequest("POST", path)
conn.putheader("Content-type", "text/xml; charset=\"UTF-8\"")
conn.putheader("Content-length", "%d" % len(xml))
conn.endheaders()
conn.send(xml)
rez = conn.getresponse()
content = rez.read()
conn.close()
return rez, content
この関数を使用してサーバーに接続しようとすると、次のエラーが表示されます。
conn.endheaders()
File "/usr/lib/python2.6/httplib.py", line 908, in endheaders
self._send_output()
File "/usr/lib/python2.6/httplib.py", line 780, in _send_output
self.send(msg)
File "/usr/lib/python2.6/httplib.py", line 739, in send
self.connect()
File "/usr/lib/python2.6/httplib.py", line 1116, in connect
self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
File "/usr/lib/python2.6/ssl.py", line 338, in wrap_socket
suppress_ragged_eofs=suppress_ragged_eofs)
File "/usr/lib/python2.6/ssl.py", line 120, in __init__
self.do_handshake()
File "/usr/lib/python2.6/ssl.py", line 279, in do_handshake
self._sslobj.do_handshake()
パイソン 2.6。奇妙なことに、1 秒に 2 回接続しようとすると、問題なく動作します。SSL でこの問題を解決するにはどうすればよいですか? 私が間違っていることは何ですか?