我正在尝试从SharePoint到Python获取列表项,下面是我用于poc的代码
ctx_auth = AuthenticationContext(url='https://SharePointSiteURL')
if ctx_auth.acquire_token_for_user(username='MyUser@Company.onmicrosoft.com',password='MyPassword'):
ctx = ClientContext('https://SharePointSiteURL', ctx_auth)
lists = ctx.web.lists
ctx.load(lists)
我得到的问题如下错误 “错误:HTTPSConnectionPool(host='login.microsoftonline.com',port=443):url:/GetUserRealm.srf超过了最大重试次数(由SSLError引起(SSLCertVerificationError(1),[SSL:CERTIFICATE\u Verification\u FAILED]CERTIFICATE Verification FAILED:无法获取本地颁发者证书(\u SSL.c:1076))”
我正在尝试设置ssl verify=none以使poc移动,有没有关于如何使用AuthenticationContext实现这一点的想法
多谢各位 内特
在最新版本中,公开了
RequestOptions.verify
属性,该属性允许:示例
可以通过底层HTTP请求对象禁用证书验证,如下所示:
注意
一旦被禁用,} warning ,这是由于向主机发出了未经验证的HTTPS请求
urllib3
可能会抱怨^{{tenant}.sharepoint.com
。强烈建议添加证书验证安装
因为它需要最新版本,所以可以从GitHub安装(直到在PyPI中发布):
相关问题 更多 >
编程相关推荐