I need to connect to an old FTP server, which uses TLS 1.0. I'm trying to enable TLS 1.0 support in my container but with no luck.
Environment: docker
Image: python:latest
What I did so far:
Changed
MinProtocol
toTLS_v1.0
in/etc/ssl/openssl.cnf
: https://github.com/SoftEtherVPN/SoftEtherVPN/issues/1358Set
ssl_version
toPROTOCOL_TLSv1
in my code:
#!/usr/local/bin/python
import ftplib
import ssl
from ftplib import FTP_TLS
ftplib.FTP_TLS.ssl_version = ssl.PROTOCOL_TLSv1
ftp = FTP_TLS('...')
ftp.login('...', '...')
ftp.retrlines('LIST')
ftp.quit()
And I'm getting this error:
File "/usr/local/lib/python3.10/ftplib.py", line 745, in login
self.auth()
File "/usr/local/lib/python3.10/ftplib.py", line 756, in auth
self.sock = self.context.wrap_socket(self.sock, server_hostname=self.host)
File "/usr/local/lib/python3.10/ssl.py", line 512, in wrap_socket
return self.sslsocket_class._create(
File "/usr/local/lib/python3.10/ssl.py", line 1070, in _create
self.do_handshake()
File "/usr/local/lib/python3.10/ssl.py", line 1341, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: NO_CIPHERS_AVAILABLE] no ciphers available (_ssl.c:997)
How should I (if at all) approach using older TLS versions in a python container?