-
-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[6.2.1 client, macOS, arm64] cannot use AES encryption: Error: cannot import python-cryptography
#4408
Comments
Something must have changed in the latest version of Here are the recent updates to |
I can reproduce the problem simply by running crypto backend init failure
Traceback (most recent call last):
File "/Users/macos12/Desktop/Xpra.app/Contents/Resources/lib/python/xpra/net/crypto.py", line 88, in crypto_backend_init
backend = default_backend()
^^^^^^^^^^^^^^^^^
File "cryptography/hazmat/backends/__init__.pyc", line 11, in default_backend
File "cryptography/hazmat/backends/openssl/__init__.pyc", line 7, in <module>
File "cryptography/hazmat/backends/openssl/backend.pyc", line 7, in <module>
ModuleNotFoundError: No module named 'cryptography.hazmat.bindings._rust'
Error: cannot import python-cryptography And I get the same failure when running |
I tried with
And I eventually landed here which led me to this comment: pyca/pyopenssl#1320 (comment)
But we're not done yet! Of course not.
This fails rather dramatically:
Followed by another few hundred lines of similar missing Python symbols. That's because of the new python packaging pep517. Lots of emojis in the output, but not very helpful with all the breakage it inflicts. Things were building just fine before this "improvement". Now, this installs pip install --target $PREFIX/lib/python3.11/site-packages . (and how are we supposed to call this from But not on
Which is fixed by setting this environment variable before calling pip:
And after all this, the crypto backend init failure
Traceback (most recent call last):
File "/Users/totaam/Desktop/Xpra.app/Contents/Resources/lib/python/xpra/net/crypto.py", line 88, in crypto_backend_init
backend = default_backend()
^^^^^^^^^^^^^^^^^
File "cryptography/hazmat/backends/__init__.pyc", line 11, in default_backend
File "cryptography/hazmat/backends/openssl/__init__.pyc", line 7, in <module>
File "cryptography/hazmat/backends/openssl/backend.pyc", line 7, in <module>
File "cryptography/hazmat/bindings/_rust.pyc", line 13, in <module>
File "cryptography/hazmat/bindings/_rust.pyc", line 9, in __load
File "imp.pyc", line 343, in load_dynamic
ImportError: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
Error: cannot import python-cryptography Which looked like a known issue with PyO3: pyca/bcrypt#694 / pyca/cryptography#9016 But it's not! $ ./Desktop/Xpra.app/Contents/Helpers/Python
Python 3.11.9 (main, Sep 14 2024, 17:51:18) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cryptography
>>> from cryptography.hazmat.backends import default_backend
>>> default_backend()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "cryptography/hazmat/backends/__init__.pyc", line 11, in default_backend
File "cryptography/hazmat/backends/openssl/__init__.pyc", line 7, in <module>
File "cryptography/hazmat/backends/openssl/backend.pyc", line 7, in <module>
File "cryptography/hazmat/bindings/_rust.pyc", line 13, in <module>
File "cryptography/hazmat/bindings/_rust.pyc", line 9, in __load
File "imp.pyc", line 343, in load_dynamic
ModuleNotFoundError: No module named '_cffi_backend' And so the correct fix is a change to our packaging script instead. @psobolewskiPhD please try version BTW, since you're using AES, be aware of some important issues - only some of which will be fully fixed in xpra 6.3: #4375 |
Wow, epic sleuthing. |
Describe the bug
Following the AES example usage (https://github.com/Xpra-org/xpra/blob/master/docs/Network/AES.md) trying to attach with 6.2.1 client on macOS arm64 (DMG downloaded from https://github.com/Xpra-org/xpra/tree/master#official-stable-downloads ) the connection fails with a traceback:
If I don't use AES, everything works, but the statistics tab also results in spam
Error: cannot import python-cryptography
To Reproduce
Steps to reproduce the behavior:
xpra start --start=xterm \ --bind-tcp=0.0.0.0:10000,encryption=AES,keyfile=aes.txt
(xpra v6.2.1-r0, ubuntu jammy, from official source)xpra attach "tcp://<ip>:10000/?encryption=AES&keyfile=./aes.txt"
System Information (please complete the following information):
Additional context
This used to work in March, so using xpra 5.0, although I needed to set:
CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1
The text was updated successfully, but these errors were encountered: