Error: TLS handshake failed: An unexpected TLS packet was received.

Need help with FileZilla Server? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Post Reply
Message
Author
itbw
500 Command not understood
Posts: 3
Joined: 2023-04-14 07:25
First name: IT
Last name: Bewell

Error: TLS handshake failed: An unexpected TLS packet was received.

#1 Post by itbw » 2023-04-14 07:41

Recently installed and trying to setup Filezilla server on WS2012 behind a Pfsense firewall, but I cant access the FTP Server remotely.
testing via ftptest.net:

Reply: 227 Entering Passive Mode (xxx,xxx,xx,xxx,255,254)
Command: MLSD
Status: Data connection established, performing TLS handshake...
Error: TLS handshake failed: An unexpected TLS packet was received.

Filezilla server setting:
Passive mode: ON
set port: to 65534 to 65534 //just for testing
use the following host: [isp static ip]
default host for local connection: Checked

Pfsense firewall entries:
Port forward: Protocol: TCP , Source: *, Port: *, Dest. Address: WAN address, Dest Port: 54321, Nat IP: 192.168.3.100, Nat Port: 21(FTP)
linked wan rule: Source: *, Port: * , Destination: 192.168.3.100, Port: 21

WS Server firewall entries:
Inbound and Outbound Rules: Local port = 21, Remote Port = 65530-65534

Is there anything else I need to setup or to configure.

User avatar
botg
Site Admin
Posts: 35566
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Error: TLS handshake failed: An unexpected TLS packet was received.

#2 Post by botg » 2023-04-14 08:45

Your port forwarding rules look suspect. For the passive mode port range you need to forward each port to the same port. Only the IP may change when forwarding.

itbw
500 Command not understood
Posts: 3
Joined: 2023-04-14 07:25
First name: IT
Last name: Bewell

Re: Error: TLS handshake failed: An unexpected TLS packet was received.

#3 Post by itbw » 2023-04-14 09:58

@botg

Revise the pfsense NAT entries to :
Port forward:
+Protocol: TCP , Source: *, Port: *, Dest. Address: WAN address, Dest Port: 54321, Nat IP: 192.168.3.100, Nat Port: 21(FTP)
+Protocol: TCP , Source: *, Port: *, Dest. Address: WAN address, Dest Port: 65330, Nat IP: 192.168.3.100, Nat Port: 21(FTP)
+Protocol: TCP , Source: *, Port: *, Dest. Address: WAN address, Dest Port: 65331, Nat IP: 192.168.3.100, Nat Port: 21(FTP)
+Protocol: TCP , Source: *, Port: *, Dest. Address: WAN address, Dest Port: 65332, Nat IP: 192.168.3.100, Nat Port: 21(FTP)
+Protocol: TCP , Source: *, Port: *, Dest. Address: WAN address, Dest Port: 65333, Nat IP: 192.168.3.100, Nat Port: 21(FTP)
+Protocol: TCP , Source: *, Port: *, Dest. Address: WAN address, Dest Port: 65334, Nat IP: 192.168.3.100, Nat Port: 21(FTP)

Filezilla server setting:
Set port: to 65530 to 65534

Connecting via FileZilla Client to remote FTP:
Error: GnuTLS error -15: An unexpected TLS packet was received.
Error: The data connection could not be established: ECONNABORTED - Connection aborted

Filezilla server log:
[Response] 220 ZXC
[Error] Control channel closed with error from source 1. Reason: EINVAL - Invalid argument passed.
[Error] GnuTLS error -110 in gnutls_record_recv: The TLS connection was non-properly terminated.

User avatar
boco
Contributor
Posts: 26940
Joined: 2006-05-01 03:28
Location: Germany

Re: Error: TLS handshake failed: An unexpected TLS packet was received.

#4 Post by boco » 2023-04-14 13:18

Nat Port and Dest. Port must be the same.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

itbw
500 Command not understood
Posts: 3
Joined: 2023-04-14 07:25
First name: IT
Last name: Bewell

Re: Error: TLS handshake failed: An unexpected TLS packet was received.

#5 Post by itbw » 2023-04-15 11:12

Changed all then NAT Port with Dest. Port, now its working. Thanks for the help

Post Reply