paul-nameless / tg

terminal telegram client
The Unlicense
952 stars 74 forks source link

Libssl ERROR: No such file or directory error when launching tg #301

Open aleeessio opened 1 year ago

aleeessio commented 1 year ago

I think that there's a problem with the versione of libssl. The 1.1 in fact is no longer installed by default, so the script should be updated to the 3.08

root@d33357df4709:~# tg
Traceback (most recent call last):
  File "/usr/local/bin/tg", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/tg/__main__.py", line 60, in main
    tg = Tdlib(
  File "/usr/local/lib/python3.10/dist-packages/telegram/client.py", line 136, in __init__
    self._tdjson = TDJson(library_path=library_path, verbosity=tdlib_verbosity)
  File "/usr/local/lib/python3.10/dist-packages/telegram/tdjson.py", line 27, in __init__
    self._build_client(library_path, verbosity)
  File "/usr/local/lib/python3.10/dist-packages/telegram/tdjson.py", line 34, in _build_client
    self._tdjson = CDLL(library_path)
  File "/usr/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libssl.so.1.1: cannot open shared object file: No such file or directory
find: ‘/root/.cache/tg/files’: No such file or directory

I've also tried do something by installing manually the library:

1. sudo apt update && sudo apt upgrade -y && sudo apt install -y wget
2. wget http://archive.debian.org/debian-archive/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.0l-1~deb9u6_amd64.deb
3. dpgk -i libssl1.1_1.1.0l-1~deb9u6_amd64.deb

The error is pretty the same, dispite it's shown in a different way. So the tg package requires libssl library at 1.1 version, but I don't know how to install it. As I said above, I've tried manually but the error it's pretty the same

Traceback (most recent call last):
  File "/usr/local/bin/tg", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/tg/__main__.py", line 60, in main
    tg = Tdlib(
  File "/usr/local/lib/python3.10/dist-packages/telegram/client.py", line 136, in __init__
    self._tdjson = TDJson(library_path=library_path, verbosity=tdlib_verbosity)
  File "/usr/local/lib/python3.10/dist-packages/telegram/tdjson.py", line 27, in __init__
    self._build_client(library_path, verbosity)
  File "/usr/local/lib/python3.10/dist-packages/telegram/tdjson.py", line 34, in _build_client
    self._tdjson = CDLL(library_path)
  File "/usr/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /lib/x86_64-linux-gnu/libcrypto.so.1.1: version `OPENSSL_1_1_1' not found (required by /usr/local/lib/python3.10/dist-packages/telegram/lib/linux/libtdjson.so)
find: ‘/root/.cache/tg/files’: No such file or directory
Bilalharoon commented 9 months ago

I compiled my own tdlibjson.so using this website then put the path to that as the tdlib_path in the config file. I got an api error but that seemed to fix the libssl issue.