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