0

I'm trying to setup an FTPS connection using both password and client certificate, but I am unable to retrieve directory listing or anything after connection established... It either hangs (does nothing) or says 500 Illegal PORT command when I use set_pasv(False). This is what happens with curl (which works) and then with Python:

niels@nielshome:~$ curl -u testuser --ftp-ssl --cert client.crt --key client.key ftp://portal.xxxxx.nl/HLCDSXX_103-001-001_GTAACCGA-AAGACACC_L003_R2.fastq.gz -O
Enter host password for user 'testuser':
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  5 2044M    5  114M    0     0  12.2M      0  0:02:47  0:00:09  0:02:38 12.5M^C
niels@nielshome:~$ python3
Python 3.6.8 (default, Jan 14 2019, 11:02:34) 
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ftplib import FTP_TLS
>>> ftps = FTP_TLS('portal.xxxxx.nl',keyfile='/home/niels/client.key',certfile='/home/niels/client.crt', user='testuser', passwd='blabla')
>>> a = ftps.mlsd()
>>> for f in a:
...     print(f)

After this just nothing happens... I've been waiting... when I say passv false it only says illegal port command, like I said above.

Niels
  • 101
  • 1
  • Now i'm getting ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:2305) – Niels Aug 04 '19 at 14:02
  • https://stackoverflow.com/questions/35581425/python-ftps-hangs-on-directory-list-in-passive-mode did it! – Niels Aug 04 '19 at 16:32

0 Answers0