Bonjour,

Je viens de configurer proftpd avec TLS sur un serveur dédié sous debian-testing.x86_64 et j'ai un soucis pour y envoyer des fichiers avec filezilla depuis mon poste sur Fedora-19.x86_64.

Lorsque je tente d'envoyer un fichier, le transfert s’arrête au bout de 131 072 octet (qui si j'ai bien compris correspond à la taille d'un paquet TCP) et filezilla m'affiche les messages suivant :
Statut :	Connecté
Statut :	Démarrage de l'envoi de /home/namour/Pictures/Thumbs/P1060638.JPG
Commande :	CWD /upload
Réponse :	250 CWD command successful
Commande :	PWD
Réponse :	257 "/upload" is the current directory
Commande :	TYPE I
Réponse :	200 Type set to I
Commande :	PASV
Réponse :	227 Entering Passive Mode (5,135,153,35,209,74).
Commande :	STOR P1060638.JPG
Réponse :	150 Opening BINARY mode data connection for P1060638.JPG
Erreur :	GnuTLS error -59 in gnutls_record_send: Erreur interne GnuTLS.
Erreur :	Could not write to transfer socket: ECONNABORTED - Connection aborted
Réponse :	226 Transfer complete
Erreur :	Echec du transfert du fichier
Par contre depuis le même client, je n'ai pas de soucis avec lftp mais gFTP gel à la commande "STOR P1060638.JPG".
Sur un autre poste sous windows 7 avec la même version de filezilla pas de soucis non plus.
J'ai aussi tenté avac une version antérieur de filezilla => même problème.

J'ai installé sur mon réseau local, pour exclure des soucis de firewall, une debian avec vsftpd toujours avec TLS et j'ai les même réactions.


Des idées ?
Tu as regardé si tu étais en mode actif ou passif. Et toujours dans filezilla dans le menu Transfert , quels type est utilisé Binary ou ASCII (qui dépends de ton serveur ftp) ?
Je suis connecté en passif et j'ai le même résultat que j'utilise le transfert Binary ou ASCII.

et gFTP bloque à cause de ça
2013-10-12 18:46:12,747 mod_tls/2.4.5[28476]: starting TLS negotiation on data connection
2013-10-12 18:46:23,850 mod_tls/2.4.5[28476]: unable to accept TLS connection: received EOF that violates protocol
2013-10-12 18:46:23,851 mod_tls/2.4.5[28476]: unable to open data connection: TLS negotiation failed
11 jours plus tard
Salut,

C'est quoi le serveur FTP en face ? ProFTPD ?
2013-10-12 18:46:23,850 mod_tls/2.4.5[28476]: unable to accept TLS connection: received EOF that violates protocol
Pour moi c'est bien une erreur serveur. Le serveur renvoie d'après le message des trames erroné ...
Le module mod_tls.c est chargé sur le serveur FTP ?
Tu a la configuration du serveur ?
Hello,

C'est bien un ProFTPd coté serveur mais je n'y ai pas accès du taff, je te donnerai les config ce soir.

Cependant c'est bizarre que cela se comporte différemment suivant les client qui s'y connecte...
Salut,

Merci RedNotesBook :-D,
Voici mes notes de l'époques (dans la langue de Shakespeare) et le lien ou j'avais trouvé l'info :

Question: My FTPS client has trouble connecting to proftpd using SSL/TLS, with the following error appearing in the TLSLog:

Sep 17 11:03:46 mod_tls/2.1.2[9628]: TLS/TLS-C requested, starting TLS handshake
Sep 17 11:03:46 mod_tls/2.1.2[9628]: unable to accept TLS connection: received EOF that violates protocol
Sep 17 11:03:46 mod_tls/2.1.2[9628]: TLS/TLS-C negotiation failed on control channel
Is this a bug in mod_tls, in the client, or something else?

Answer: There might be several different causes for this error. It could be a bug in the OpenSSL library, in mod_tls, in the FTPS client, or it could be a transient network issue.
Now, one possible thing to try is to use the following in your proftpd.conf file:

TLSOptions NoCertRequest
This option tells the OpenSSL library to not include a message requesting the client's certificate in the SSL/TLS handshake messages. Some older SSL implementations seem to have trouble with this certificate request message, and react badly. This includes some Windows FTP clients, as well as some FTP clients for the Mac.
One user tried using both the Transmit and the Fetch applications for the Mac; both state that they can handle FTP over SSL/TLS. Using both of these applications, the user saw the above error. The user, when using Transmit, saw the following error message appear from the client:

Server said:
AUTH TLS successful
error:00000000:lib(0):func(0):reason(0)
And when using Fetch, the error message displayed by that client was:

SSL Error -9844
Server responded: "AUTH TLS successful"
In both causes, using "TLSOptions NoCertRequest" appeared to make those clients happy.

http://www.proftpd.org/docs/howto/TLS.html
Bonjour et merci pour cette réponse.

Avec l'option "TLSOptions NoCertRequest" je n'ai plus de message d'erreur dan le tls.log mais toujours le même soucis avec Filezilla.

Voici mes fichiers de conf :
proftpd.conf
#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes reload proftpd after modifications.
#

# Includes DSO modules
Include /etc/proftpd/modules.conf

# Set off to disable IPv6 support which is annoying on IPv4 only boxes.
UseIPv6                         off
# If set on you can experience a longer connection delay in many cases.
IdentLookups                    off

ServerName                      "Siberien.tf"
ServerType                      standalone
ServerIdent                     on "Serveur FTP de Siberien.tf"
DeferWelcome                    off

MultilineRFC2228                on
DefaultServer                   on

# on cache les liens symboliques
ShowSymlinks                    off

TimeoutNoTransfer               600
TimeoutStalled                  600
TimeoutIdle                     1200

DisplayLogin                    welcome.msg
DisplayChdir                    .message true

# On limite le nombre de tentatives de login à 3.
MaxLoginAttempts                 3

# nombre de connections par client
MaxClientsPerHost               3

# nombres de clients max
MaxClients                      10

# TRES IMPORTANT : permettra de cacher les fichiers cachés :o)
#ListOptions                    "-l"
ListOptions                     "" strict

DenyFilter                      \*.*/

# On chroot tous les users dans leur home
DefaultRoot                     ~

# On désactive le login root
RootLogin                        off

# directive qui n'affiche pas les fichiers cachés
<Directory />
  HideFiles ^\..*
  <Limit ALL>
    IgnoreHidden On
  </Limit>
</Directory>

# Pas de shell pour les users
RequireValidShell               off

# Port 21 is the standard FTP port.
Port                            21021

# In some cases you have to specify passive ports range to by-pass
# firewall limitations. Ephemeral ports can be used for that, but
# feel free to use a more narrow range.
PassivePorts                  53000 54000

# If your host was NATted, this option is useful in order to
# allow passive tranfers to work. You have to use your public
# address and opening the passive ports used on your firewall as well.
#MasqueradeAddress      www.mondomaine.fr

# This is useful for masquerading address with dynamic IPs:
# refresh any configured MasqueradeAddress directives every 8 hours
<IfModule mod_dynmasq.c>
# DynMasqRefresh 28800
</IfModule>

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances                    30

# Set the user and group that the server normally runs at.
User                            proftpd
Group                           nogroup
# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask                           022  022
# Normally, we want files to be overwriteable.
AllowOverwrite                  on

# Autorise la reprise des téléchargements.
AllowRetrieveRestart on

# Autorise les clients à reprendre les Uploads vers vous.
AllowStoreRestart on

# Autorise seulement les noms de fichiers normaux (caractères alphanumérique)
PathAllowFilter "[a-zA-Z0-9]"

# Refuse l'upload de fichiers .ftpaccess ou .htaccess
PathDenyFilter "(\.ftp)|(\.hta)[a-z]+$"

# N'autorise pas de passer des printf-Formats.
AllowFilter "^[a-zA-Z0-9@~ /,_.-]*$"
DenyFilter "%"

# Récupère l'ip de la machine de l'utilisateur
 IdentLookups                   on
# Uncomment this if you are using NIS or LDAP via NSS to retrieve passwords:
# PersistentPasswd              off

# This is required to use both PAM-based authentication and local passwords
# AuthOrder                     mod_auth_pam.c* mod_auth_unix.c

# Be warned: use of this directive impacts CPU average load!
# Uncomment this if you like to see progress and transfer rate with ftpwho
# in downloads. That is not needed for uploads rates.
#
# UseSendFile                   off

TransferLog /var/log/proftpd/xferlog
SystemLog   /var/log/proftpd/proftpd.log

# pour la gestions des users
<IfModule mod_sql.c>
 SQLBackend            mysql
</IfModule>

<IfModule mod_quotatab.c>
QuotaEngine             off
</IfModule>
<IfModule mod_ratio.c>
Ratios                  off
</IfModule>


# Delay engine reduces impact of the so-called Timing Attack described in
# http://security.lss.hr/index.php?page=details&ID=LSS-2004-10-02
# It is on by default.
<IfModule mod_delay.c>
DelayEngine             on
</IfModule>

<IfModule mod_ctrls.c>
ControlsEngine        on
ControlsMaxClients    2
ControlsLog           /var/log/proftpd/controls.log
ControlsInterval      5
ControlsSocket        /var/run/proftpd/proftpd.sock
</IfModule>

<IfModule mod_ctrls_admin.c>
AdminControlsEngine     on
</IfModule>
#
# Alternative authentication frameworks
#
#Include /etc/proftpd/ldap.conf
#Include /etc/proftpd/sql.conf

#
# This is used for FTPS connections
#
Include /etc/proftpd/tls.conf

#
# Useful to keep VirtualHost/VirtualRoot directives separated
#
#Include /etc/proftpd/virtuals.conf

# Mod MySQL
# =========
# Les mots de passe sont cryptés dans la base avec la fonction ENCRYPT (MySQL)
SQLAuthTypes OpenSSL
SQLAuthenticate users* groups*
SQLMinUserGID 30
SQLMinUserUID 30
# Modifiez cette ligne selon l'utilisateur et le mot de passe defini plus tôt
SQLConnectInfo proftpd@localhost proftpd xxxHiDdEnxxx

# On donne à ProFTPd le nom des colonnes de la table usertable
SQLUserInfo ftpuser userid passwd uid gid homedir shell
SQLUserWhereClause "LoginAllowed = 'true'"

# On donne à ProFTPd le nom des colonnes de la table "grouptable"
SQLGroupInfo ftpgroup groupname gid members

# Création automatique du répertoire de l'utilisateur si il n'existe pas
CreateHome              on

# Met à jour les compteurs à chaque connection d'un utilisateur
SQLLog PASS updatecount
SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE userid='%u'" ftpuser

# Met à jour les compteurs à chaque upload ou download d'un utilisateur
SQLLog STOR,RETR modified
SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser

# Mod quota
# =========
QuotaEngine off
# QuotaDirectoryTally on
# QuotaDisplayUnits Mb
# QuotaShowQuotas on

# Définit les requetes SQL pour que ProFTPd récupère les infos sur les quotas
SQLNamedQuery get-quota-limit SELECT "name, quota_type, par_session, limit_type, bytes_up_limit, bytes_down_limit, bytes_transfer_limit, file$

SQLNamedQuery get-quota-tally SELECT "name, quota_type, bytes_up_total, bytes_down_total, bytes_transfer_total, files_up_total, files_down_to$

SQLNamedQuery update-quota-tally UPDATE "bytes_up_total = bytes_up_total + %{0}, bytes_down_total = bytes_down_total + %{1}, bytes_transfer_t$

SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" ftpquotatotal

QuotaLimitTable sql:/get-quota-limit
QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally

# Gestion des logs
# ================
# Enregistre les requêtes SQL dans /var/log/proftpd/mysql.log
SQLLogFile /var/log/proftpd/mysql.log

# Enregistre les authentifications
LogFormat auth "%v [%P] %h %t \"%r\" %s"
ExtendedLog /var/log/proftpd/auth.log AUTH auth

# Enregistre les accès aux fichiers
LogFormat write "%h %l %u %t \"%r\" %s %b"
ExtendedLog /var/log/proftpd/access.log WRITE,READ write
tls.conf :
#
# Proftpd sample configuration for FTPS connections.
#
# Note that FTPS impose some limitations in NAT traversing.
# See http://www.castaglia.org/proftpd/doc/contrib/ProFTPD-mini-HOWTO-TLS.html
# for more information.
#

<IfModule mod_tls.c>
TLSEngine                               on
TLSLog                                  /var/log/proftpd/tls.log
TLSProtocol                             SSLv23
#
# Server SSL certificate. You can generate a self-signed certificate using
# a command like:
#
# openssl req -x509 -newkey rsa:1024 \
#          -keyout /etc/ssl/private/proftpd.key -out /etc/ssl/certs/proftpd.crt \
#          -nodes -days 365
#
# The proftpd.key file must be readable by root only. The other file can be
# readable by anyone.
#
# chmod 0600 /etc/ssl/private/proftpd.key
# chmod 0640 /etc/ssl/private/proftpd.key
#
TLSRSACertificateFile                   /etc/ssl/certs/proftpd.crt
TLSRSACertificateKeyFile                /etc/ssl/private/proftpd.key
TLSOptions NoCertRequest
#
# CA the server trusts...
#TLSCACertificateFile                    /etc/ssl/certs/CA.pem
# ...or avoid CA cert and be verbose
#TLSOptions                      NoCertRequest EnableDiags
# ... or the same with relaxed session use for some clients (e.g. FireFtp)
#TLSOptions                      NoCertRequest EnableDiags NoSessionReuseRequired
#
#
# Per default drop connection if client tries to start a renegotiate
# This is a fix for CVE-2009-3555 but could break some clients.
#
# TLSOptions                                                    AllowClientRenegotiations
#
# Authenticate clients that want to use FTP over TLS?
#
TLSVerifyClient                         off
#
# Are clients required to use FTP over TLS when talking to this server?
#
TLSRequired                             on
#
# Allow SSL/TLS renegotiations when the client requests them, but
# do not force the renegotations.  Some clients do not support
# SSL/TLS renegotiations; when mod_tls forces a renegotiation, these
# clients will close the data connection, or there will be a timeout
# on an idle data connection.
#
# TLSRenegotiate                          required off
</IfModule>
Pour info j'ai contourné le problème en ne protégeant par TLS que l'authentification et pas le transfert des données, grâce au paramètre :
TLSRequired !data
Salut,

Tu as essayé en passant la Renegociation a on ?
TLSRenegotiate                          required on
As tu une entropie suffisante coté client ?