电报不再接受通配符证书。在pythonanywhere中获取错误

问题描述 投票:0回答:1

当我在pythonanywhere上部署我的机器人时,我无法向机器人发送消息。由于电报不再支持通配符证书(如官方pythonanywhere博客link to the blog post中所述),服务器无法收到错误消息。如果有人知道此问题,请帮我。

  raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bottokenvalue/sendMessage (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f094debf050>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
2020-01-17 21:58:04,377: Retrying (Retry(total=2, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f094da4c610>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /bottoken/sendMessage
2020-01-17 21:58:05,377: Retrying (Retry(total=1, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f094da4c4d0>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /bottokenbot/sendMessage
2020-01-17 21:58:06,377: Retrying (Retry(total=0, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f094da4c810>: Failed to establish a new connection: [Errno 101] Network is unreachable')': 
python telegram telegram-bot pythonanywhere telepot
1个回答
1
投票

这种突然缺乏对通配符证书的支持,只会影响使用webhook支持构建(并托管在具有通配符证书的域上的机器人)。

可能有一些解决方法:

  • 从机器人中删除webhook支持。除非它是低流量的bot /供个人使用,并且您出于某种原因未实现webhook支持,否则这可能是最不希望的。如果没有webhook支持,您的机器人将以客户端的身份连接到电报API,而不是充当电报系统连接到的服务器。

  • 转到支持custom domains的Python付费帐户。使用自定义域,然后可以使用非通配符证书来configure this。您可以从“加密”获得免费证书。

您当然可以借此机会转移到另一台主机,但是要小心,因为许多相似的主机将仅为其通行帐户支持通配符证书:任何会为您提供youraccount.provider.tld公开网址的东西>

© www.soinside.com 2019 - 2024. All rights reserved.