Setup failed with openssl error

I have just installed homeassistant and I am having an issue on first (and subsequent) startups.

2021-11-06 00:13:33 ERROR (MainThread) [homeassistant.setup] Setup failed for cloud: Unable to import component: ... hass/rootfs/srv/homeassistant/lib/python3.8/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so: undefined symbol: OPENSSL_sk_num

It looks like it has to do with the version of openssl I have installed, do you have any idea?

This is my configuration:

Python 3.8.9
homeassistant 2021.10.6
cryptography 3.4.8
OpenSSL 1.1.1k

I was able to isolate the issue and reproduce it using python CLI and cryptography

Python 3.8.9 (default, Apr  3 2021, 01:02:10) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cryptography
>>> cryptography.__version__
'3.4.8'
>>> from cryptography.hazmat.bindings._openssl import ffi, lib

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /home/phablet/.cache/libertine-container/hass/rootfs/srv/homeassistant/lib/python3.8/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so: undefined symbol: OPENSSL_sk_num

What type of HA installation did you use? “Core”, i.e. a venv?

You might try pip3 install --upgrade --force-reinstall cryptography to force a rebuild of cryptography with the openssl you currently have.