0
在我的項目中,我們試圖使用CMIS來獲取文件夾存儲庫,並使用python腳本來測試它;下面是我使用的那段代碼使用CmisClient庫連接到安全網站
from cmislib.model import CmisClient
client = CmisClient('http://localhost/CMIS/Service/servicedoc', 's', 's')
repo = client.defaultRepository
info = repo.info
for k,v in info.items():
print "%s:%s" % (k,v)
somefld = repo.getObject('idf_96_Z2CMIS')
props = somefld.properties
for k,v in props.items():
print "%s:%s" % (k,v)
這段代碼工作得很好。然而現在的服務已啓用SSL,以便(HTTPS //本地主機/ CMIS /服務/ servicedoc)當我改變的URL CmisClient它拋出下面的錯誤
c:\Python27>python.exe cmis.py
CMIS client connection to https://localhost/Cmis/Service/servicedoc
Traceback (most recent call last):
File "cmis.py", line 4, in <module>
repo = client.defaultRepository
File "c:\Python27\lib\site-packages\cmislib-0.5.1-py2.7.egg\cmislib\model.py",
line 179, in getDefaultRepository
File "c:\Python27\lib\site-packages\cmislib-0.5.1-py2.7.egg\cmislib\model.py",
line 206, in get
File "c:\Python27\lib\site-packages\cmislib-0.5.1-py2.7.egg\cmislib\net.py", l
ine 145, in get
File "c:\Python27\lib\urllib2.py", line 404, in open
response = self._open(req, data)
File "c:\Python27\lib\urllib2.py", line 422, in _open
'_open', req)
File "c:\Python27\lib\urllib2.py", line 382, in _call_chain
result = func(*args)
File "c:\Python27\lib\urllib2.py", line 1222, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "c:\Python27\lib\urllib2.py", line 1184, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 10054] An existing connection was forcibly closed by the remote host>
我如何使用CMISClient庫連接到SSL啓用網站。提前致謝。
該https網址是否在瀏覽器中正常工作? – Gagravarr
是的。有用。只是想知道如何使用cmisClient庫調用啓用SSL的站點 – SanthaKS
您可以查看您的服務器日誌,並查看它是否報告任何SSL連接問題?我想知道你的服務器和python不能達成一套合適的SSL連接選項 – Gagravarr