Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

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

Open
@hAcKlyc

Description

本地直接测试的时候会有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问题会在什么情况下可以不用处理么?

Metadata

Assignees

Labels

bug发生了错误

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions