Python:requests.exceptions.SSLError
我正在尝试使用下面的python脚本创建一个页面Python:requests.exceptions.SSLError,python,ssl,Python,Ssl,我正在尝试使用下面的python脚本创建一个页面 from atlassian import Confluence confluence = Confluence( url='https://my.domain.com', username='admin', password='admin') status = confluence.create_page( space='DEMO', title='This is the title', bo
from atlassian import Confluence
confluence = Confluence(
url='https://my.domain.com',
username='admin',
password='admin')
status = confluence.create_page(
space='DEMO',
title='This is the title',
body='This is the body. You can use <strong>HTML tags</strong>!')
print(status)
来自atlassian import Confluence的
合流(
url='1〕https://my.domain.com',
username='admin',
密码(='admin')
状态=汇流。创建页面(
太空舱,
title='这是标题',
body='这是body。您可以使用HTML标记!'))
打印(状态)
在上面运行脚本时遇到错误,如下所示
requests.exceptions.SSLError:HTTPSConnectionPool(host='my.domain.com',port=443):url:/rest/api/content超过了最大重试次数(由SSLError引起(SSLError(1,u'[SSL:CERTIFICATE\u VERIFY\u FAILED]CERTIFICATE VERIFY FAILED(_SSL.c:618')))
查看
Confluence(
url='https://my.domain.com',
username='admin',
password='admin',
verify_ssl=False
)
但是,如果这起作用,则无法解决汇流rest api中SSL连接的问题…@tgrandje我正在尝试获取URL响应的status.code,但失败
from atlassian import Confluence
confluence = Confluence(
url='https://my.domain.com',
username='admin',
password='admin')
resp = confluence.create_page(
space='DEMO',
title='This is the title',
body='This is the body. You can use <strong>HTML tags</strong>!')
print(resp.status_code)
来自atlassian import Confluence的
合流(
url='1〕https://my.domain.com',
username='admin',
密码(='admin')
resp=confluence.create\u页面(
太空舱,
title='这是标题',
body='这是body。您可以使用HTML标记!'))
打印(各自的状态代码)
这里是错误
AttributeError:“dict”对象没有属性“status\u code”
我在请求方面遇到了很多问题(就您的异常而言,Confluence似乎使用了该属性)。我现在主要使用带有“verify=True”参数的请求。。。但也许你不能直接在汇流模块中强制这样做,即使我已经通过了90c295ab99c0b1ae3aa/atlassian/rest_client.py#L27,但它不起作用。面对“`verify\u ssl=False^SyntaxError:无效语法”``如果使用群组用户管理,如何获取令牌并在此处传递?奇怪。。。Confluence类的init方法中有一个kwargs,它继承了AtlassianRestApi(它有一个verify_ssl参数)。你检查过你的模块是否有相同的代码吗?对不起,我无法帮助你使用群组api,我没有使用这些模块(虽然我一直在使用请求,这让我想起了我的SSL问题…)-顺便问一下,你能发布你使用的atlassian版本吗?这很奇怪,create_页面确实应该返回一个请求对象(我认为)。您是否检查了此模块的版本,并对照github中的内容进行了检查?