SSL/TLS for FTP connections


I have CentOS and VSFTPD installed.

I want to use FTP for only SSL/TLS connection type.
I have generated certificate, loaded necesary module for iptables, opened ports, configured VSFTPD but I get this error:
GnuTLS error -8: A record packet with illegal version was received.

I tried out this articled but nothing helps:

Thanks for suggestion!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Daniel HelgenbergerCommented:
At first glance this seems to be a client side problem. Please elaborate how you connect to the server?

If so, you need to enable ssl after making the connection;
$ lftp -e 'set ftp:ssl-force true' yourserver

Open in new window

This might also help:

For the config:
celjan79Author Commented:
helge000: I know the articles from your URL. I have read them before and did not change my problem.
Yes i connect with FileZilla to server over internet. I only alowe SSL connections.
Daniel HelgenbergerCommented:
Does the lftp command show the same error?
To debug this, please try from your client computer:
telnet yourserver 21
openssl s_client -connect yourserver:21
gnutls yourserver 21

Open in new window

Is one or all of those working? Eg, you getting some useful output)

Also, it might help if you post part of your vsftpd config
Redefine Your Security with AI & Machine Learning

The implications of AI and machine learning in cyber security are massive and constantly growing, creating both efficiencies and new challenges across the board. Check out our on-demand webinar to learn more about how AI can help your organization!

celjan79Author Commented:
# openssl s_client -connect localhost:21
140051988035400:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:699:
no peer certificate available
No client certificate CA names sent
SSL handshake has read 7 bytes and written 112 bytes
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE

Seems like I have problem with certificate? :S
Daniel HelgenbergerCommented:
No, all seems to be fine.
Did you try lftp?
lftp -e 'set ftp:ssl-force true'

Open in new window

Do this with your server.
And: Are you sure you use FTPS and not SFTP?
celjan79Author Commented:
helge000: I tried your command. There was no error.

Hmm whats the difference between FTPS and SFTP. I use implicit FTP over SSL option in Filezilla.

This is part of conf file for VSFTPD:
# Select which SSL ciphers vsftpd will allow for encrypted SSL connections (required by FileZilla)
Daniel HelgenbergerCommented:
To be clear, you were able to connect to your server using lftp?
If so, there is a misconfig in FileZilla (?)

You are using FTPS; not sftp. SFTP is completely different: it is FTP via ssh using port 22 while your config is FTPS.
celjan79Author Commented:
When I use "dir" command when connected with LFTP to localhost i get this error:
Fatal error: gnutls_record_recv: A record packet with illegal version was received.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
celjan79Author Commented:
There was a problem with debuging in VSFTPD. It seems that VSFTPD does not show everything. So I had permision problems. You can read more on this URL:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.