I have a shared hosted server with FTPS access, and I can connect it trough Filezilla with the following configuration:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
            <User>[email protected]</User>
            <Comments />
            <LocalDir />
            <RemoteDir />

With ncftp is more simple, I just use the following command ncftp -u [email protected] -P 21 ftp://ftp.idrissi.co.

But, when I try to access with the lftp tool it fail. With lftp, I use the following configuration:

1d [fauve:~/lftptest] % openssl s_client -starttls ftp -crlf -connect ftp.idrissi.co:21 > ftp-idrissi-temp.cert 

1d [fauve:~/lftptest] 130 % cat ftp-idrissi-temp.cert | pcregrep -M '\-----BEGIN CERTIFICATE-----(.*\n)*.*-----END CERTIFICATE-----' > ftp-idrissi.cert 
1d [fauve:~/lftptest] % vim ftp-idrissi.cert 
1d [fauve:~/lftptest] % cat lftp-script
set ftps:initial-prot P
set ftp:ssl-force true
set ftp:ssl-protect-data true
set ssl:cert-file ./ftp-idrissi.cert
1d [fauve:~/lftptest] % lftp -e "`cat lftp-script| sed 's/\n/; /'`"  -p 21 -u [email protected] ftps://ftp.idrissi.co                                                                          
ls: Erreur fatale: gnutls_handshake: An unexpected TLS packet was received.
1d [fauve:~/lftptest] 1 % lftp -e "`cat lftp-script| sed 's/\n/; /'`"  -p 21 -u [email protected] ftp://ftp.idrissi.co 
ls: Erreur fatale: Certificate verification: certificate common name doesn't match requested host name « ftp.idrissi.co »

I try many variations on the lftp-script but it doesn’t work. And I don’t understand how Fillezilla could do it with a minimalist config. So, how can I connect to my FTP account?


1 Answer 1


Finaly, I get it.

The problem is resolved by set ssl:check-hostname false.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .