alexanderhenne / teleport

📡 AmpliFi Teleport for computers
MIT License
25 stars 7 forks source link

Error while creating Teleport token from PIN #6

Open Eriond opened 9 months ago

Eriond commented 9 months ago

When I execute python main.py --pin {ccnnn}, I get the result: ERROR:root:'cryptography.hazmat.bindings._rust.x509.Certificat' object has no attribute '_x509'

Upon first trying to generate the token, I got a warning about having an old version of pyOpenSSL, followed by this error: value=certificate_digest(self._cert._x509), # type: ignore ERROR:root:[WinError 2] The system cannot find the file specified After upgrading, I get the error message stated above(top). Is there anything more I can provide to help resolve the issue?

Eriond commented 9 months ago

...so, after reading back and forth about newer versions of the Python Cryptography libraries, I decided to uninstall the new pyOpenSSL, and then just use pip install "Cryptography==38" This meant that I got the initial warning messages back, but also gave some more insight about the (probable) root cause of this issue: some sort of file access/permission gone wrong. This is way beyond my skills to sort out, so instead I hand you this Python error log output, and hope it may shed some light:


>python main.py
C:\Users\m\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\aiortc\rtcdtlstransport.py:211: CryptographyDeprecationWarning: This version of cryptography contains a temporary pyOpenSSL fallback path. Upgrade pyOpenSSL now.
  _openssl_assert(lib.SSL_CTX_use_certificate(ctx, self._cert._x509) == 1)  # type: ignore
C:\Users\m\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\aiortc\rtcdtlstransport.py:186: CryptographyDeprecationWarning: This version of cryptography contains a temporary pyOpenSSL fallback path. Upgrade pyOpenSSL now.
  value=certificate_digest(self._cert._x509),  # type: ignore
Traceback (most recent call last):
  File "main.py", line 31, in <module>
    print(connect_device(deviceToken))
  File "C:\Users\m\Downloads\teleport-main\teleport.py", line 218, in connect_device
    return loop.run_until_complete(coro)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "C:\Users\m\Downloads\teleport-main\teleport.py", line 146, in _connect_device_peer
    privateKey, publicKey = _generate_wg_keys()
  File "C:\Users\m\Downloads\teleport-main\teleport.py", line 21, in _generate_wg_keys
    privateKey = subprocess.check_output(["wg", "genkey"],
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1311, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified```

There are two files created in the same folder, named `teleport_token_0` and `teleport_uuid`, and they do contain data that seem relevant to the task.