genouest / biomaj-download

Download microservice for BioMAJ
GNU Affero General Public License v3.0
1 stars 7 forks source link

Allow to bypass SSL problems #8

Closed duboism closed 4 years ago

duboism commented 5 years ago

FTPDownload can handle ftps:// url-schema (FTP with implicit SSL). However, there are some common problems with SSL: some servers have incorrect certificates or host identity, etc.

For example, the test server at demo.wftpserver.com works with FTP but not with FTPS because of a SSL issue:

from biomaj_download.download.ftp import FTPDownload

print("FTP")
ftp = FTPDownload("ftp", "demo.wftpserver.com", "/download/")
ftp.set_credentials("demo-user:demo-user")
(file_list, dir_list) = ftp.list()
print(file_list, dir_list)
ftp.match(["^manual_en.pdf$"], file_list, dir_list)
print(ftp.files_to_download)
ftp.download("/tmp/ftp/")

del ftp

print("FTPS")
ftps = FTPDownload("ftps", "demo.wftpserver.com", "/download/")
ftps.set_credentials("demo-user:demo-user")
(file_list, dir_list) = ftps.list()
print(file_list, dir_list)
ftps.match(["^manual_en.pdf$"], file_list, dir_list)
print(ftps.files_to_download)
ftps.download("/tmp/ftps/")

The curl command as the option -k/--insecure for such cases. It would be nice to have such an option in FTPDownload.

duboism commented 4 years ago

I think we can close this since PR #14 solves this.