Hello Tom and thank you.
Unfortunately it does not work (see attached syslog)
1/ I replaced ftpupload.py in /usr/sare/weewx/weeutil
2/ added ciphers = 'DEFAULT@SECLEVEL=1' in the [[FTP]] section of weewx.conf
3/ put back in the file /etc/ssl/openssl.cnf the last line "CipherString = DEFAULT@SECLEVEL=2" (as originally by default).
4/ Stopped WeeWX and restarted
--> If I put DEFAULT@SECLEVEL=1 in the openssl.cnf file, same thing in the syslog.
--> If I stop WeeWX and restart it (with the new FTP.py), it works again as before... But with DEFAULT@SECLEVEL=1 in openssl.cnf! :-(
If you have an idear... ?
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: ftpgenerator: (0): caught exception '<class 'ssl.SSLError'>': [SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1123)
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** Traceback (most recent call last):
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/share/weewx/weewx/reportengine.py", line 436, in run
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** n = ftp_data.run()
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/share/weewx/weeutil/ftpupload.py", line 175, in run
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** ftp_server.login(self.user, self.password)
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/lib/python3.9/ftplib.py", line 738, in login
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** self.auth()
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/lib/python3.9/ftplib.py", line 749, in auth
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** self.sock = self.context.wrap_socket(self.sock, server_hostname=self.host)
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/lib/python3.9/ssl.py", line 500, in wrap_socket
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** return self.sslsocket_class._create(
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/lib/python3.9/ssl.py", line 1040, in _create
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** self.do_handshake()
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/lib/python3.9/ssl.py", line 1309, in do_handshake
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** self._sslobj.do_handshake()
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** ssl.SSLError: [SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1123)
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: ftpgenerator: (1): caught exception '<class 'ssl.SSLError'>': [SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1123)
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** Traceback (most recent call last):
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/share/weewx/weewx/reportengine.py", line 436, in run
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** n = ftp_data.run()
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/share/weewx/weeutil/ftpupload.py", line 175, in run
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** ftp_server.login(self.user, self.password)
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/lib/python3.9/ftplib.py", line 738, in login
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** self.auth()
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/lib/python3.9/ftplib.py", line 749, in auth
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** self.sock = self.context.wrap_socket(self.sock, server_hostname=self.host)
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/lib/python3.9/ssl.py", line 500, in wrap_socket
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** return self.sslsocket_class._create(
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/lib/python3.9/ssl.py", line 1040, in _create
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** self.do_handshake()
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/lib/python3.9/ssl.py", line 1309, in do_handshake
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** self._sslobj.do_handshake()
Jun 27 09:41:11 localhost weewx[30338] ERROR weewx.reportengine: **** ssl.SSLError: [SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1123)
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: ftpgenerator: (2): caught exception '<class 'ssl.SSLError'>': [SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1123)
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: **** Traceback (most recent call last):
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/share/weewx/weewx/reportengine.py", line 436, in run
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: **** n = ftp_data.run()
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/share/weewx/weeutil/ftpupload.py", line 175, in run
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: **** ftp_server.login(self.user, self.password)
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/lib/python3.9/ftplib.py", line 738, in login
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: **** self.auth()
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/lib/python3.9/ftplib.py", line 749, in auth
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: **** self.sock = self.context.wrap_socket(self.sock, server_hostname=self.host)
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/lib/python3.9/ssl.py", line 500, in wrap_socket
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: **** return self.sslsocket_class._create(
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/lib/python3.9/ssl.py", line 1040, in _create
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: **** self.do_handshake()
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: **** File "/usr/lib/python3.9/ssl.py", line 1309, in do_handshake
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: **** self._sslobj.do_handshake()
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: **** ssl.SSLError: [SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c:1123)
Jun 27 09:41:12 localhost weewx[30338] ERROR weewx.reportengine: ftpgenerator: Upload failed