Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

本地测试使用novelAI配置会有SSL报错,需要手动修改一下请求的参数 #14

Open
hAcKlyc opened this issue Dec 10, 2022 · 1 comment
Assignees
Labels
bug 发生了错误

Comments

@hAcKlyc
Copy link

hAcKlyc commented Dec 10, 2022

本地直接测试的时候会有SSL报错,信息为
aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host pypi.org:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')]

需要对这个方法做一下调整
nonebot_plugin_novelai/backend/base.py
修改前
async def post_(self, header: dict, post_api: str, json: dict): # 请求交互 async with aiohttp.ClientSession(headers=header) as session:

修改后

async def post_(self, header: dict, post_api: str, json: dict): # 请求交互 async with aiohttp.ClientSession(headers=header, connector=aiohttp.TCPConnector(ssl=False)) as session:

另外还有一些其他网络请求的方法也会有影响,比如那个version检查的函数
至于这个是不是正常,我不太了解哈,这个ssl问题会在什么情况下可以不用处理么?

@sena-nana
Copy link
Owner

因为sd,naifu有的用http有得用https,所以协议在内部统一用的http,你填入参数的时候把协议头去掉就可以了

@sena-nana sena-nana added the bug 发生了错误 label Dec 11, 2022
@sena-nana sena-nana self-assigned this Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 发生了错误
Projects
None yet
Development

No branches or pull requests

2 participants