1

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" ?>
<FileZilla3>
    <Servers>
        <Server>
            <Host>ftp.idrissi.co</Host>
            <Port>21</Port>
            <Protocol>4</Protocol>
            <Type>0</Type>
            <User>user@idrissi.co</User>
            <Logontype>2</Logontype>
            <TimezoneOffset>0</TimezoneOffset>
            <PasvMode>MODE_DEFAULT</PasvMode>
            <MaximumMultipleConnections>0</MaximumMultipleConnections>
            <EncodingType>Auto</EncodingType>
            <BypassProxy>0</BypassProxy>
            <Name>ftp.idrissi.co</Name>
            <Comments />
            <LocalDir />
            <RemoteDir />
            <SyncBrowsing>0</SyncBrowsing>ftp.idrissi.co
        </Server>
    </Servers>
</FileZilla3>

With ncftp is more simple, I just use the following command ncftp -u user@idrissi.co -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
ls       
1d [fauve:~/lftptest] % lftp -e "`cat lftp-script| sed 's/\n/; /'`"  -p 21 -u user@idrissi.co 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 user@idrissi.co 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?

2

Finaly, I get it.

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.