最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Python SSL_Error when using systemctl - Stack Overflow

programmeradmin2浏览0评论

I have an Old Ubuntu server image running on an old laptop and I want to run a discord bot on it, and everything worked fine with it until I tried to make a service out of it. When I do that, it gives me the exact same SSL error that it gave before updating CA_CERTIFICATES. I tried both systemd and supervisor, they gave the same error.

aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discord:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1147)')]

I tried updating the certificates and downloading certifi to no avail, I also tried this snippet:

import ssl 

try:
    _create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
    pass
else:
    ssl._create_default_https_context = _create_unverified_https_context

from here. None of it worked.

发布评论

评论列表(0)

  1. 暂无评论