Forums

ClientConnectorError: Cannot connect to host api.telegram.org:443 ssl:default [Network is unreachable]

Hello. When trying to host a telegram bot on the aiogram library, I encountered the following error: ClientConnectorError: Cannot connect to host api.telegram.org:443 ssl:defa ult [Network is unreachable] As far as I understand, the error is related to the fact that I can’t connect to the Telegram API, but I can’t understand why, because the Telegram API is on the white list.

It sounds like the library you are using is not proxy-aware -- most HTTP libraries are able to pick up the details of the proxy to use from the system environment, but some do not. You'll need to find out how to configure that library to use a proxy, and then provide the details. You can get the proxy server hostname and port from Bash -- just run

echo $http_proxy