You are not logged in.

#1 2019-09-23 08:01:58

doctorzeus
Member
Registered: 2011-12-24
Posts: 79

[SOLVED] VSFTPD Causing "GnuTLS error -15" on filezilla with SSL

Hello,

Lots of googling with no solutions to this problem unfortunately and after at least a solid 12 hours trying to solve this i'm loosing it a bit! hmm

Problem already exists here however none of the provided solutions helped and noticed it was already solved after I necrobumped (oops). Also went through at least first 2 pages of search results on google so can't say I haven't tried with this one!

As the title describes I am trying to enable SSL on my VSFTPD. I get different errors on different FTP clients however on FileZilla I get the most helpful one:

GnuTLS error -15: An unexpected TLS packet was received

Attemping to mount the FTP server with curlftpfs gives the following error:

Error connecting to ftp: error:1408F10B:SSL routines:ssl3_get_record:wrong version number

.

A lot of sites have suggested that SSL is hiding the actual issue however everything works fine when SSL is disabled.

Here is my vsftpd.conf file:

# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
#xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
nopriv_user=ftp
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
chroot_local_user=YES
#chroot_list_enable=NO
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
#
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd with two configuration files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YES

# Set own PAM service name to detect authentication settings specified
# for vsftpd by the system package.
pam_service_name=vsftpd

ssl_enable=YES

# if you accept anonymous connections, you may want to enable this setting
allow_anon_ssl=NO

# by default all non anonymous logins and forced to use SSL to send and receive password and data, set to NO to allow non secure connections
force_local_logins_ssl=NO
force_local_data_ssl=NO

# TLS v1 protocol connections are preferred and this mode is enabled by default while SSL v2 and v3 are disabled
# the settings below are the default ones and do not need to be changed unless you specifically need SSL
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO

# provide the path of your certificate and of your private key
# note that both can be contained in the same file or in different files
rsa_cert_file=/etc/ssl/certs/vsftpdCertificate.pem
rsa_private_key_file=/etc/ssl/certs/vsftpdServerkey.pem

# this setting is set to YES by default and requires all data connections exhibit session reuse which proves they know the secret of the control channel.
# this is more secure but is not supported by many FTP clients, set to NO for better compatibility
require_ssl_reuse=NO

#ssl_ciphers=AES128-SHA256
ssl_ciphers=HIGH

#pasv_enable=YES
#pasv_min_port=6000
#pasv_max_port=7000
#pasv_address=127.0.0.1

#debug_ssl=YES

In addition the full trace of FileZilla in debug mode:

Trace:	CRealControlSocket::DoClose(66)
Trace:	CControlSocket::DoClose(66)
Trace:	CControlSocket::DoClose(66)
Trace:	CControlSocket::SendNextCommand()
Trace:	CFtpLogonOpData::Send() in state 0
Status:	Connecting to 127.0.0.1:21...
Status:	Connection established, waiting for welcome message...
Trace:	CFtpControlSocket::OnReceive()
Response:	220 (vsFTPd 3.0.3)
Trace:	CFtpLogonOpData::ParseResponse() in state 1
Trace:	CControlSocket::SendNextCommand()
Trace:	CFtpLogonOpData::Send() in state 2
Command:	AUTH TLS
Trace:	CFtpControlSocket::OnReceive()
Response:	234 Proceed with negotiation.
Trace:	CFtpLogonOpData::ParseResponse() in state 2
Status:	Initializing TLS...
Trace:	tls_layer_impl::client_handshake()
Trace:	tls_layer_impl::continue_handshake()
Trace:	TLS handshake: About to send CLIENT HELLO
Trace:	TLS handshake: Sent CLIENT HELLO
Trace:	tls_layer_impl::on_send()
Trace:	tls_layer_impl::continue_handshake()
Trace:	tls_layer_impl::on_read()
Trace:	tls_layer_impl::continue_handshake()
Trace:	tls_layer_impl::on_read()
Trace:	tls_layer_impl::continue_handshake()
Trace:	tls_layer_impl::failure(-15)
Error:	GnuTLS error -15: An unexpected TLS packet was received.
Status:	Connection attempt failed with "ECONNABORTED - Connection aborted".
Trace:	CRealControlSocket::OnSocketError(103)
Trace:	CRealControlSocket::DoClose(66)
Trace:	CControlSocket::DoClose(66)
Trace:	CFtpControlSocket::ResetOperation(66)
Trace:	CControlSocket::ResetOperation(66)
Trace:	CFtpLogonOpData::Reset(66) in state 4
Error:	Could not connect to server
Trace:	CFileZillaEnginePrivate::ResetOperation(66)

Any advise on how to fix this would be greatly appreciated!

Many Thanks

Last edited by doctorzeus (2019-09-27 03:29:24)

Offline

#2 2019-09-23 10:27:34

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,112
Website

Re: [SOLVED] VSFTPD Causing "GnuTLS error -15" on filezilla with SSL

TLS 1.0 is deprecated. Does it work if you use

ssl_tlsv1_2=YES

instead of

ssl_tlsv1=YES

Also you might wanna post the server's log with

debug_ssl=YES

enabled.

Last edited by schard (2019-09-23 10:29:46)


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#3 2019-09-23 11:22:09

doctorzeus
Member
Registered: 2011-12-24
Posts: 79

Re: [SOLVED] VSFTPD Causing "GnuTLS error -15" on filezilla with SSL

schard wrote:

TLS 1.0 is deprecated. Does it work if you use

ssl_tlsv1_2=YES

instead of

ssl_tlsv1=YES

Also you might wanna post the server's log with

debug_ssl=YES

enabled.

Thanks for the reply smile .


ssl_tlsv1_2=YES

I did try that but unfortunately this makes vsftpd throw stderr 2 ("status=2/INVALIDARG") on startup (same as with tlsv1_1 arg). I did find this strange as there are many articles on the web referencing it's use however it seems to complain its invalid whenever I try to use it but it's not mentioned anywhere in the vsftpd.conf man page so I kind of assumed it was depreciated..?

debug_ssl=YES

This doesn't seem to do anything  unfortunately (i.e. no noticable extra details in "/var/log/vsftpd.log"), unless it's logged somewhere else I don't know about?

Thanks

Offline

#4 2019-09-23 11:55:19

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,945

Re: [SOLVED] VSFTPD Causing "GnuTLS error -15" on filezilla with SSL

Some things I noticed :

ssl_enable=YES

Manpage states this is supposed to make vsftpd use openSSL .
The filezilla error however mentions using gnuTLS .
Maybe an incompatibility between an openssl server and a gnutls client ?

curlftpfs seems to want to use ssl v3 , which is (and should be!) disabled on the server.



# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
#xferlog_std_format=YES

please post that logfile.

Last edited by Lone_Wolf (2019-09-23 11:56:21)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#5 2019-09-23 13:44:35

doctorzeus
Member
Registered: 2011-12-24
Posts: 79

Re: [SOLVED] VSFTPD Causing "GnuTLS error -15" on filezilla with SSL

Lone_Wolf wrote:

Some things I noticed :

ssl_enable=YES

Manpage states this is supposed to make vsftpd use openSSL .
The filezilla error however mentions using gnuTLS .
Maybe an incompatibility between an openssl server and a gnutls client ?

curlftpfs seems to want to use ssl v3 , which is (and should be!) disabled on the server.



# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
#xferlog_std_format=YES

please post that logfile.

Thanks for the reply.

vsftpd.log doesn't have much unfortunately (this is with SSL debugging enabled on vsftpd):

Mon Sep 23 21:18:07 2019 [pid 2] CONNECT: Client "127.0.0.1"
Mon Sep 23 21:18:12 2019 [pid 2] CONNECT: Client "127.0.0.1"

In regards to "/var/log/xferlog" the file is empty.

Thanks

Offline

#6 2019-09-26 23:01:16

Chuck Arch Linux
Member
Registered: 2011-06-23
Posts: 81

Re: [SOLVED] VSFTPD Causing "GnuTLS error -15" on filezilla with SSL

Have you tried with this option in your vsftpd.conf :

seccomp_sandbox=NO

Offline

#7 2019-09-27 03:29:02

doctorzeus
Member
Registered: 2011-12-24
Posts: 79

Re: [SOLVED] VSFTPD Causing "GnuTLS error -15" on filezilla with SSL

Chuck Arch Linux wrote:

Have you tried with this option in your vsftpd.conf :

seccomp_sandbox=NO

That works! big_smile

Fantastic thanks! big_smile

Will need to add this to the wiki in case anyone else had this problem.

Thanks Again!

Offline

Board footer

Powered by FluxBB