Erreur OpenSSL lors du renouvellement de mon certificat HTTPS

Bonjour , j’ai à priori le même problème , je suis en debian 10.8 et j’ai une erreur au renouvellement du certificat, j’ai tenté la méthode snap mais le problème persiste :

> Citation<pi@raspberrypi:~ $ sudo certbot renew --dry-run
Traceback (most recent call last):
  File "/snap/certbot/4183/bin/certbot", line 5, in <module> 
    from certbot.main import main
  File "/snap/certbot/4183/lib/python3.12/site-packages/certbot/main.py", line 6, in <module>
    from certbot._internal import main as internal_main
  File "/snap/certbot/4183/lib/python3.12/site-packages/certbot/_internal/main.py", line 20, in <module>
    import josepy as jose
  File "/snap/certbot/4183/lib/python3.12/site-packages/josepy/__init__.py", line 40, in <module>
    from josepy.json_util import (
  File "/snap/certbot/4183/lib/python3.12/site-packages/josepy/json_util.py", line 24, in <module>
    from OpenSSL import crypto
  File "/snap/certbot/4183/lib/python3.12/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import SSL, crypto
  File "/snap/certbot/4183/lib/python3.12/site-packages/OpenSSL/SSL.py", line 11, in <module>
    from OpenSSL._util import (
  File "/snap/certbot/4183/lib/python3.12/site-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/snap/certbot/4183/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 15, in <module>
    from cryptography.exceptions import InternalError
  File "/snap/certbot/4183/lib/python3.12/site-packages/cryptography/exceptions.py", line 9, in <module>
    from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
RuntimeError: OpenSSL 3.0's legacy provider failed to load. This is a fatal error by default, but cryptography supports running without legacy algorithms by setting the environment variable CRYPTOGRAPHY_OPENSSL_NO_LEGACY. If you did not expect this error, you have likely made a mistake with your OpenSSL configuration.>

Comment avez vous fait exactement ?

Bonjour Akenad,

Peux-tu apporter des précisions sur le point suivant ?

et la réinstallation du paquet cryptography.

Comment la réinstallation du paquet de cryptograhie doit-être réalisée ?

La réinstallation doit-être effectuée après l’exécution de la commande suivante qui va ajouter une variable d’environnement si j’ai bien compris :

export CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1

Mon certificat est encore valide pour 10 jours et j’obtiens la même erreur lorsque je réalise la commande suivante : sudo certbot certificates --cert-name MONDOMAINE
Impossible de renouveler mon certificat également

Mon installation :

Merci pour ton aide.

Reis

Bonjour,

s’agissant du contexte, voir plus haut ce que j’ai déjà écrit au sujet :
-du RPi3B+
-de la méthode d’installation de Debian11
-des 3 méthodes différentes identifiées d’installation de certbot (apt, snap, pip)

Donc la manière de réinstaller le paquet python cryptography pour que cerbot fonctionne
dépend de la méthode utilisée pour installer certbot.

Ce que je peux suggérer n’est pas du tout garantit. et attention au certificat existant.
L’impact sur ton environnement va dépendre de toutes les commandes que tu as pu déjà exécuter.

méthode apt :
apt install python3-cryptography

méthode pip :
pip install cryptography

méthode snap :
snap install --classic certbot

Et à toutes fins utiles : 43.0.0 breaks cryptography on Debian 11 Bullseye (ImportError: libssl.so.3) · Issue #11370 · pyca/cryptography · GitHub

akenad :slight_smile:

Salut,

Super, merci pour ton retour. J’avais suivi un tuto (sur ce site) pour l’installation. Je vais essayer de retrouver cela pour voir quel méthode j’avais utilisé.

Il me reste encore 9 jours, je ferai les manips au dernier moment (pour Jérémy cela à l’air d’avoir fonctionné), en attendant on aura peut-être une solution « officielle » car on a l’air d’être plusieurs dans ce cas. Je suis peut-être très optimiste lol.

Merci encore.

Reis

Bonjour,

Il n’y aura pas de solution officielle puisque celle-ci existe déjà et fonctionne : dns Jeedom.

Bonjour,

Un grand merci pour cette aide.

Malheureusement, j’ai dû faire une ou des mauvaises manip, j’ai cette erreur quand je lance un renew : ModuleNotFoundError: No module named ‹ urllib3 ›.

Lorsque je lance l’install apt install python3-cryptography, j’ai ce message : python3-cryptography is already the newest version (3.3.2-1+deb11u1).

J’avoue ne plus trop savoir quoi faire.

Si un expert peut me conseiller ?
Un grand merci d’avance.

Tu peux peut-être déjà répondre à la question que je t’ai posée plus haut il y a 4 jours :

akenad :slight_smile:

Oups, je n’avais pas vu la question… C’est une réinstall.

Quel est la méthode d’installation que tu as utilisée lors de la première installation de certbot,
apt, snap ou pip ?

akenad :slight_smile:

Bonjour Akenad,
apt mais c’est peut etre l’objet de mon erreur, j’ai du tenter des choses incompatibles entre elles…

Ce serait moi je tenterai (en ssh root) :

apt update

apt remove certbot

puis installation de certbot par la méthode snap.

akenad :slight_smile:

1 « J'aime »

Merci Akenad pour ton aide.

C’est résolu :
C’est la désinstall de certbot via apt qui a réglé le problème (et la commande export CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1).
Il n’a pas pu réinstaller certbot via snap car il l’était déjà.

Encore merci et bon week-end !

1 « J'aime »

Salut a tous

Perso je suis en raspbian 11.8 sur raspberry pi2 B+ en python 3.9.2
J’avais la même erreur sur deux machines config os pareil.
Je suis revenu en arrière sur l’install de snap version plus ancienne via la commande:

 sudo snap refresh certbot --channel=latest/stable --revision 3120

et la commande:

sudo snap refresh --hold=1680h certbot

En attendant de migrer sur une nouvelle install

Bien a vous

Bonjour a tous, voici ma methode pour faire refonctionner certbot

je suis sur un PI3B+ Debian10 / 32 bits (va falloir upgrader soft/hard sous peu, jeedom tire la langue c’est clair!)

j’avais

pi@jeedom:~ $ openssl version
OpenSSL 1.1.1n  15 Mar 2022
pi@jeedom:~ $ pip list | grep cryptography
cryptography                     2.6.1

pi@jeedom:~ $ certbot --version
Traceback (most recent call last):
  File "/snap/certbot/4194/bin/certbot", line 5, in <module>
    from certbot.main import main
  File "/snap/certbot/4194/lib/python3.12/site-packages/certbot/main.py", line 6, in <module>
    from certbot._internal import main as internal_main
  File "/snap/certbot/4194/lib/python3.12/site-packages/certbot/_internal/main.py", line 20, in <module>
    import josepy as jose
  File "/snap/certbot/4194/lib/python3.12/site-packages/josepy/__init__.py", line 40, in <module>
    from josepy.json_util import (
  File "/snap/certbot/4194/lib/python3.12/site-packages/josepy/json_util.py", line 24, in <module>
    from OpenSSL import crypto
  File "/snap/certbot/4194/lib/python3.12/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import SSL, crypto
  File "/snap/certbot/4194/lib/python3.12/site-packages/OpenSSL/SSL.py", line 11, in <module>
    from OpenSSL._util import (
  File "/snap/certbot/4194/lib/python3.12/site-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/snap/certbot/4194/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 15, in <module>
    from cryptography.exceptions import InternalError
  File "/snap/certbot/4194/lib/python3.12/site-packages/cryptography/exceptions.py", line 9, in <module>
    from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
RuntimeError: OpenSSL 3.0's legacy provider failed to load. This is a fatal error by default, but cryptography supports running without legacy algorithms by setting the environment variable CRYPTOGRAPHY_OPENSSL_NO_LEGACY. If you did not expect this error, you have likely made a mistake with your OpenSSL configuration.

changer la variable d’env n’a rien donné

pi@jeedom:~ $ export CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1

pi@jeedom:~ $ echo $CRYPTOGRAPHY_OPENSSL_NO_LEGACY
1

pi@jeedom:~ $ sudo certbot renew
Traceback (most recent call last):
  File "/snap/certbot/4194/bin/certbot", line 5, in <module>
    from certbot.main import main
  File "/snap/certbot/4194/lib/python3.12/site-packages/certbot/main.py", line 6, in <module>
    from certbot._internal import main as internal_main
  File "/snap/certbot/4194/lib/python3.12/site-packages/certbot/_internal/main.py", line 20, in <module>
    import josepy as jose
  File "/snap/certbot/4194/lib/python3.12/site-packages/josepy/__init__.py", line 40, in <module>
    from josepy.json_util import (
  File "/snap/certbot/4194/lib/python3.12/site-packages/josepy/json_util.py", line 24, in <module>
    from OpenSSL import crypto
  File "/snap/certbot/4194/lib/python3.12/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import SSL, crypto
  File "/snap/certbot/4194/lib/python3.12/site-packages/OpenSSL/SSL.py", line 11, in <module>
    from OpenSSL._util import (
  File "/snap/certbot/4194/lib/python3.12/site-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/snap/certbot/4194/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 15, in <module>
    from cryptography.exceptions import InternalError
  File "/snap/certbot/4194/lib/python3.12/site-packages/cryptography/exceptions.py", line 9, in <module>
    from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
RuntimeError: OpenSSL 3.0's legacy provider failed to load. This is a fatal error by default, but cryptography supports running without legacy algorithms by setting the environment variable CRYPTOGRAPHY_OPENSSL_NO_LEGACY. If you did not expect this error, you have likely made a mistake with your OpenSSL configuration.

j’ai donc désinstallé la version SNAP et installé via APT

pi@jeedom:~ $ sudo snap remove certbot
certbot removed

pi@jeedom:~ $ sudo apt install certbot python3-certbot-apache
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  augeas-lenses libaugeas0 python-pyicu python3-acme python3-augeas python3-certbot python3-configargparse python3-configobj python3-future
  python3-josepy python3-mock python3-parsedatetime python3-pbr python3-requests-toolbelt python3-rfc3339 python3-tz python3-zope.component
  python3-zope.event python3-zope.hookable python3-zope.interface
Suggested packages:
  augeas-doc python3-certbot-nginx python-certbot-doc augeas-tools python-acme-doc python-certbot-apache-doc python-configobj-doc
  python-future-doc python-mock-doc
The following NEW packages will be installed:
  augeas-lenses certbot libaugeas0 python-pyicu python3-acme python3-augeas python3-certbot python3-certbot-apache python3-configargparse
  python3-configobj python3-future python3-josepy python3-mock python3-parsedatetime python3-pbr python3-requests-toolbelt python3-rfc3339
  python3-tz python3-zope.component python3-zope.event python3-zope.hookable python3-zope.interface
0 upgraded, 22 newly installed, 0 to remove and 0 not upgraded.
Need to get 2098 kB of archives.
After this operation, 9655 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf augeas-lenses all 1.11.0-3 [442 kB]
Get:2 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-josepy all 1.1.0-2 [27.7 kB]
Get:3 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-pbr all 4.2.0-5 [56.5 kB]
Get:4 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-mock all 2.0.0-4 [60.3 kB]
Get:5 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-requests-toolbelt all 0.8.0-1 [38.2 kB]
Get:6 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-tz all 2019.1-1 [27.1 kB]
Get:7 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-rfc3339 all 1.1-1 [6644 B]
Get:8 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-acme all 0.31.0-2 [50.5 kB]
Get:9 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-configargparse all 0.13.0-1 [22.5 kB]
Get:10 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-configobj all 5.0.6-3 [35.7 kB]
Get:11 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-future all 0.16.0-1 [346 kB]
Get:12 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-parsedatetime all 2.4-2 [39.7 kB]
Get:13 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-zope.hookable armhf 4.0.4-4+b3 [10.3 kB]
Get:14 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-zope.interface armhf 4.3.2-1+b2 [88.6 kB]
Get:15 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-zope.event all 4.2.0-1 [8412 B]
Get:16 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-zope.component all 4.3.0-1 [43.0 kB]
Get:17 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-certbot all 0.31.0-1+deb10u1 [226 kB]
Get:18 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf certbot all 0.31.0-1+deb10u1 [38.8 kB]
Get:19 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf libaugeas0 armhf 1.11.0-3 [271 kB]
Get:20 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python-pyicu armhf 2.2-2 [181 kB]
Get:21 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-augeas all 0.5.0-1 [9046 B]
Get:22 http://mirrors.ircam.fr/pub/raspbian/raspbian buster/main armhf python3-certbot-apache all 0.31.0-1 [69.7 kB]
Fetched 2098 kB in 3s (718 kB/s)              
apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_TIME = "fr_FR.UTF-8",
	LC_MONETARY = "fr_FR.UTF-8",
	LC_ADDRESS = "fr_FR.UTF-8",
	LC_TELEPHONE = "fr_FR.UTF-8",
	LC_NAME = "fr_FR.UTF-8",
	LC_MEASUREMENT = "fr_FR.UTF-8",
	LC_IDENTIFICATION = "fr_FR.UTF-8",
	LC_NUMERIC = "fr_FR.UTF-8",
	LC_PAPER = "fr_FR.UTF-8",
	LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_GB.UTF-8").
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously unselected package augeas-lenses.
(Reading database ... 77044 files and directories currently installed.)
Preparing to unpack .../00-augeas-lenses_1.11.0-3_all.deb ...
Unpacking augeas-lenses (1.11.0-3) ...
Selecting previously unselected package python3-josepy.
Preparing to unpack .../01-python3-josepy_1.1.0-2_all.deb ...
Unpacking python3-josepy (1.1.0-2) ...
Selecting previously unselected package python3-pbr.
Preparing to unpack .../02-python3-pbr_4.2.0-5_all.deb ...
Unpacking python3-pbr (4.2.0-5) ...
Selecting previously unselected package python3-mock.
Preparing to unpack .../03-python3-mock_2.0.0-4_all.deb ...
Unpacking python3-mock (2.0.0-4) ...
Selecting previously unselected package python3-requests-toolbelt.
Preparing to unpack .../04-python3-requests-toolbelt_0.8.0-1_all.deb ...
Unpacking python3-requests-toolbelt (0.8.0-1) ...
Selecting previously unselected package python3-tz.
Preparing to unpack .../05-python3-tz_2019.1-1_all.deb ...
Unpacking python3-tz (2019.1-1) ...
Selecting previously unselected package python3-rfc3339.
Preparing to unpack .../06-python3-rfc3339_1.1-1_all.deb ...
Unpacking python3-rfc3339 (1.1-1) ...
Selecting previously unselected package python3-acme.
Preparing to unpack .../07-python3-acme_0.31.0-2_all.deb ...
Unpacking python3-acme (0.31.0-2) ...
Selecting previously unselected package python3-configargparse.
Preparing to unpack .../08-python3-configargparse_0.13.0-1_all.deb ...
Unpacking python3-configargparse (0.13.0-1) ...
Selecting previously unselected package python3-configobj.
Preparing to unpack .../09-python3-configobj_5.0.6-3_all.deb ...
Unpacking python3-configobj (5.0.6-3) ...
Selecting previously unselected package python3-future.
Preparing to unpack .../10-python3-future_0.16.0-1_all.deb ...
Unpacking python3-future (0.16.0-1) ...
Selecting previously unselected package python3-parsedatetime.
Preparing to unpack .../11-python3-parsedatetime_2.4-2_all.deb ...
Unpacking python3-parsedatetime (2.4-2) ...
Selecting previously unselected package python3-zope.hookable.
Preparing to unpack .../12-python3-zope.hookable_4.0.4-4+b3_armhf.deb ...
Unpacking python3-zope.hookable (4.0.4-4+b3) ...
Selecting previously unselected package python3-zope.interface.
Preparing to unpack .../13-python3-zope.interface_4.3.2-1+b2_armhf.deb ...
Unpacking python3-zope.interface (4.3.2-1+b2) ...
Selecting previously unselected package python3-zope.event.
Preparing to unpack .../14-python3-zope.event_4.2.0-1_all.deb ...
Unpacking python3-zope.event (4.2.0-1) ...
Selecting previously unselected package python3-zope.component.
Preparing to unpack .../15-python3-zope.component_4.3.0-1_all.deb ...
Unpacking python3-zope.component (4.3.0-1) ...
Selecting previously unselected package python3-certbot.
Preparing to unpack .../16-python3-certbot_0.31.0-1+deb10u1_all.deb ...
Unpacking python3-certbot (0.31.0-1+deb10u1) ...
Selecting previously unselected package certbot.
Preparing to unpack .../17-certbot_0.31.0-1+deb10u1_all.deb ...
Unpacking certbot (0.31.0-1+deb10u1) ...
Selecting previously unselected package libaugeas0:armhf.
Preparing to unpack .../18-libaugeas0_1.11.0-3_armhf.deb ...
Unpacking libaugeas0:armhf (1.11.0-3) ...
Selecting previously unselected package python-pyicu.
Preparing to unpack .../19-python-pyicu_2.2-2_armhf.deb ...
Unpacking python-pyicu (2.2-2) ...
Selecting previously unselected package python3-augeas.
Preparing to unpack .../20-python3-augeas_0.5.0-1_all.deb ...
Unpacking python3-augeas (0.5.0-1) ...
Selecting previously unselected package python3-certbot-apache.
Preparing to unpack .../21-python3-certbot-apache_0.31.0-1_all.deb ...
Unpacking python3-certbot-apache (0.31.0-1) ...
Setting up python3-configargparse (0.13.0-1) ...
Setting up python3-requests-toolbelt (0.8.0-1) ...
Setting up augeas-lenses (1.11.0-3) ...
Setting up python3-zope.event (4.2.0-1) ...
Setting up python3-zope.interface (4.3.2-1+b2) ...
Setting up python3-pbr (4.2.0-5) ...
update-alternatives: using /usr/bin/python3-pbr to provide /usr/bin/pbr (pbr) in auto mode
Setting up python-pyicu (2.2-2) ...
Setting up python3-tz (2019.1-1) ...
Setting up python3-mock (2.0.0-4) ...
Setting up python3-zope.hookable (4.0.4-4+b3) ...
Setting up python3-configobj (5.0.6-3) ...
Setting up libaugeas0:armhf (1.11.0-3) ...
Setting up python3-josepy (1.1.0-2) ...
Setting up python3-augeas (0.5.0-1) ...
Setting up python3-future (0.16.0-1) ...
update-alternatives: using /usr/bin/python3-futurize to provide /usr/bin/futurize (futurize) in auto mode
update-alternatives: using /usr/bin/python3-pasteurize to provide /usr/bin/pasteurize (pasteurize) in auto mode
Setting up python3-rfc3339 (1.1-1) ...
Setting up python3-parsedatetime (2.4-2) ...
Setting up python3-zope.component (4.3.0-1) ...
Setting up python3-acme (0.31.0-2) ...
Setting up python3-certbot (0.31.0-1+deb10u1) ...
Setting up certbot (0.31.0-1+deb10u1) ...
Created symlink /etc/systemd/system/timers.target.wants/certbot.timer → /lib/systemd/system/certbot.timer.
Setting up python3-certbot-apache (0.31.0-1) ...
Processing triggers for man-db (2.8.5-2+deb10u1) ...
Processing triggers for libc-bin (2.28-10+rpt2+rpi1+deb10u2) ...

certbot donnait cette erreur :


pi@jeedom:~ $ sudo certbot version
/usr/bin/certbot:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import load_entry_point
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests_toolbelt/_compat.py", line 49, in <module>
    from requests.packages.urllib3.contrib import appengine as gaecontrib
ImportError: cannot import name 'appengine' from 'requests.packages.urllib3.contrib' (/usr/local/lib/python3.7/dist-packages/urllib3/contrib/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/certbot", line 11, in <module>
    load_entry_point('certbot==0.31.0', 'console_scripts', 'certbot')()
  File "/usr/local/lib/python3.7/dist-packages/pkg_resources/__init__.py", line 536, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python3.7/dist-packages/pkg_resources/__init__.py", line 2931, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python3.7/dist-packages/pkg_resources/__init__.py", line 2518, in load
    return self.resolve()
  File "/usr/local/lib/python3.7/dist-packages/pkg_resources/__init__.py", line 2524, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3/dist-packages/certbot/main.py", line 21, in <module>
    from certbot import client
  File "/usr/lib/python3/dist-packages/certbot/client.py", line 16, in <module>
    from acme import client as acme_client
  File "/usr/lib/python3/dist-packages/acme/client.py", line 15, in <module>
    from requests_toolbelt.adapters.source import SourceAddressAdapter
  File "/usr/lib/python3/dist-packages/requests_toolbelt/__init__.py", line 12, in <module>
    from .adapters import SSLAdapter, SourceAddressAdapter
  File "/usr/lib/python3/dist-packages/requests_toolbelt/adapters/__init__.py", line 12, in <module>
    from .ssl import SSLAdapter
  File "/usr/lib/python3/dist-packages/requests_toolbelt/adapters/ssl.py", line 16, in <module>
    from .._compat import poolmanager
  File "/usr/lib/python3/dist-packages/requests_toolbelt/_compat.py", line 51, in <module>
    from urllib3.contrib import appengine as gaecontrib
ImportError: cannot import name 'appengine' from 'urllib3.contrib' (/usr/local/lib/python3.7/dist-packages/urllib3/contrib/__init__.py)

un recherche rapide m’a mené ici

urllib3 was installed by both apt and pip. I removed the pip version by issuing:

pip3 uninstall urllib3

Now certbot work fine.

j’ai donc désinstall urllib3 en sudo

pi@jeedom:~ $ sudo pip3 uninstall urllib3
Found existing installation: urllib3 2.0.7
Uninstalling urllib3-2.0.7:
  Would remove:
    /usr/local/lib/python3.7/dist-packages/urllib3-2.0.7.dist-info/*
    /usr/local/lib/python3.7/dist-packages/urllib3/*
Proceed (Y/n)? 
  Successfully uninstalled urllib3-2.0.7

et j’ai maintenant :

pi@jeedom:~ $ sudo certbot renew
/usr/bin/certbot:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import load_entry_point
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/XXX.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Attempting to parse the version 2.11.0 renewal configuration file found at /etc/letsencrypt/renewal/XXX.conf with version 0.31.0 of Certbot. This might not work.
Cert not yet due for renewal

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

The following certs are not due for renewal yet:
  /etc/letsencrypt/live/XXX/fullchain.pem expires on 2025-01-14 (skipped)
No renewals were attempted.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

j’espere que ca pourra aider !
A+
FHRBT

Hello FHRBT, merci tu me sauves :grin:, j’ai à nouveau mon certificat fonctionnel :slight_smile: , je n’ai pas eu exactement les mêmes réponses que toi mais cela a bien fonctionné avec la commande sudo pip3 uninstall urllib3

pi@raspberrypi:~ $ sudo apt install certbot python3-certbot-apache
Reading package lists... Done
Building dependency tree
Reading state information... Done
certbot is already the newest version (0.31.0-1+deb10u1).
python3-certbot-apache is already the newest version (0.31.0-1).
The following packages were automatically installed and are no longer required:
  libdav1d3 python-colorzero
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~ $ sudo pip3 uninstall urllib3
Found existing installation: urllib3 2.0.7
Uninstalling urllib3-2.0.7:
  Would remove:
    /usr/local/lib/python3.7/dist-packages/urllib3-2.0.7.dist-info/*
    /usr/local/lib/python3.7/dist-packages/urllib3/*
Proceed (Y/n)? Y
  Successfully uninstalled urllib3-2.0.7

1 « J'aime »

Bonjour,
Personnellement je ne sais plus quelle méthode j’ai utilisée pour installer certbot sur mon debian 10.
Au vu des remarques, j’ai monté un disque en debian 11 (je l’avais reporté faute de temps, comme ça fonctionnait je m’inquiétais pas trop, mais cette erreur de certificat m’a fait prendre le temps nécessaire).
J’ai donc installé debian 11 avec pi imager puis j’ai injecté ma sauvegarde de jeedom sur un autre disque, jusque là tout fonctionne.
Ma question est donc quelle methode me conseillez vous pour installer certbot pour éviter que cette erreur réapparaisse?

En vous remerciant par avance pour l’aide apportée

bonjour,j’ai reussi à renouveller mon certificat grace aux commandes :« sudo snap remove certbot »
puis
« sudo apt install certbot python3-certbot-apache » et enfin « sudo certbot renew » .Merci à tous .

Bonjour à tous,

Pour la part je n’arrive pas à m’en sortir et je ne suis pas un professionnel de la ligne de code, je suis électricien lol.
C’est une première install pour moi car je veux faire fonctionner Telegram.

J’avais suivi ce tuto :

Comment sécuriser l'accès à Jeedom en HTTPS avec un certificat SSL gratuit - Page 3 sur 3

et depuis que j’ai cette erreur OpenSSL 3.0’s j’avais cherché là aussi :

https://doc.jeedom.com/fr_FR/howtoadvance/letsencrypt.mise_en_place

Ensuit j’ai trouvé votre ce sujet

J’ai donc fait ce que vous préconisez mais toujours la même erreur. J’avoue ne pas réussir à m’en sortir

Je suis sous Debian 11 (fraichement réinstallé) avec PI3B+
la version OpenSSL 1.1.1w
cryptography 2.6.1

Voici ma démarche

Florian@jeedom:~ $ sudo apt install snapd
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
snapd is already the newest version (2.49-1+rpi1+deb11u2).
The following packages were automatically installed and are no longer required:
augeas-lenses libaugeas0 python3-acme python3-augeas python3-certbot python3-configargparse python3-configobj python3-icu python3-josepy python3-jwt python3-parsedatetime python3-requests-toolbelt python3-responses python3-rfc3339 python3-tz python3-zope.component python3-zope.event python3-zope.hookable
python3-zope.interface
Use ‹ sudo apt autoremove › to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Florian@jeedom:~ $ sudo snap install --classic certbot
certbot 3.0.1 from Certbot Project (certbot-eff✓) installed
Florian@jeedom:~ $ sudo ln -s /snap/bin/certbot /usr/bin/certbot
Florian@jeedom:~ $ sudo certbot certonly --apache
Traceback (most recent call last):
File « /snap/certbot/4194/bin/certbot », line 5, in
from certbot.main import main
File « /snap/certbot/4194/lib/python3.12/site-packages/certbot/main.py », line 6, in
from certbot._internal import main as internal_main
File « /snap/certbot/4194/lib/python3.12/site-packages/certbot/_internal/main.py », line 20, in
import josepy as jose
File « /snap/certbot/4194/lib/python3.12/site-packages/josepy/init.py », line 40, in
from josepy.json_util import (
File « /snap/certbot/4194/lib/python3.12/site-packages/josepy/json_util.py », line 24, in
from OpenSSL import crypto
File « /snap/certbot/4194/lib/python3.12/site-packages/OpenSSL/init.py », line 8, in
from OpenSSL import SSL, crypto
File « /snap/certbot/4194/lib/python3.12/site-packages/OpenSSL/SSL.py », line 11, in
from OpenSSL._util import (
File « /snap/certbot/4194/lib/python3.12/site-packages/OpenSSL/_util.py », line 6, in
from cryptography.hazmat.bindings.openssl.binding import Binding
File « /snap/certbot/4194/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/binding.py », line 15, in
from cryptography.exceptions import InternalError
File « /snap/certbot/4194/lib/python3.12/site-packages/cryptography/exceptions.py », line 9, in
from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
RuntimeError: OpenSSL 3.0’s legacy provider failed to load. This is a fatal error by default, but cryptography supports running without legacy algorithms by setting the environment variable CRYPTOGRAPHY_OPENSSL_NO_LEGACY. If you did not expect this error, you have likely made a mistake with your OpenSSL configuration.

Comment m’assurer que je n’ai pas installé avec des méthodes différentes et comment désinstaller les autres ?

Merci d’avance.

Bonjour la communauté,

Pour information et si cela peut aider, j’ai rencontré le même problème OpenSSL 3.0 lors de mon renouvellement de certificat. j’étais en Debian 10 sur un RPI 4B. a force de tester des solutions ma config s’est plantée !
J’en ai donc profité pour refaire un nouveau ssd sur la version debian 11.11. J’ai réinstallé la sauvegarde Jeedom précédamment externalisée (Heureusement !). Tout refonctionnait hormis la connexion réseau externe car plus de certificat installé.
Les versions OpenSSL et Cryptography :
image
image

Voici donc les instructions que j’ai utilisé en ssh au Raspberry pour réinstaller le certficat qui refonctionne correctement :

Etape non necessaire si départ d’une installation nouvelle mais au cas ou… .Désinstallation des certificats actuels (en fonction de la méthode d’installation initiale)
sudo apt-get remove certbot
sudo dnf remove certbot
sudo yum remove certbot
sudo snap remove certbot

Puis installation de snap sur le Raspberry
sudo apt update
sudo apt install snapd

reboot du Raspberry
sudo reboot

Installer le core snap afin d’obtenir la dernière version snapd :
sudo snap install core

Installer Certbot :
sudo snap install --classic certbot

Tester que la commande certbot peut être executée :
sudo ln -s /snap/bin/certbot /usr/bin/certbot

Installer certificat :
sudo certbot –apache (bien saisir son adresse mail et son nom de domaine)

Mettre en place le renouvellement automatique :
sudo certbot renew --dry-run

Test version de certbot :
certbot --version
image

test des versions OpennSSL et Cryptography qui sont restée les mêmes qu’auparavant:
image

sudo certbot renew ( pour tester si certificat ok )
Et la page santé de jeedom après installation : Accès réseau externe est en OK !

Si cela peut aider…

1 « J'aime »

Salut,
Apparement le sujet est l’objet de la version 3.0.1 de certbot mais n’est tj pas soldé :

Je suis dans la meme m****, j’ai fais la mise à jour vers debian 11 et plus de lien externe ! (procédure faite sur snap, mais rien ne fonctionne à date, avec certbot en 3.0.1, open ssl en 1.1.1w et crypto en 38.0.4 !).
le debug est d’ajouter « CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1 » avant chaque commande certbot en attendant un fix

Le DNS jeedom, on l’a avec le premier SP c’est ca ? pas possible de l’acheter seul ?