FluentFTP: Unable to connect to Filezilla Server using FluentFTP.GnuTls

FTP Server OS: Windows

FTP Server Type: FileZilla server

Client Computer OS: Windows

FluentFTP Version: 46.0.2

Framework: .NET 6

After updating our FileZilla server to the latest version, we started getting errors when connecting to our server in parallel using FluentFTP (37.0.1). The cause of these errors was related to TLS session resumption.

FluentFTP.Exceptions.FtpCommandException : Code: 425 Message: Unable to build data connection: TLS session of data connection not resumed.

After a lot of investigating, we decided to try out the FluentFTP.GnuTls library. Now we get a different error however, where we can’t even get past the TLS handshake when connecting. Using Wireshark, we notice that the connection gets killed after the CLIENT HELLO request.

At the client side, we get following error: FluentFTP.GnuTLS.GnuTlsException : Error : *GnuTlsHandShake(…) failed: (-110) GNUTLS_E_PREMATURE_TERMINATION.

When we look at the FileZilla server logs, we see error -344 (GNUTLS_E_NO_APPLICATION_PROTOCOL | No common application protocol could be negotiated.) which seems to be related to APLN. We can’t figure out however what exactly is wrong, and how to get past this error. Connecting to the FileZilla server works as expected when connecting through FileZilla client, and also when connecting through FluentFTP without the GnuTLS library but without any parallellisation .

Logs :

Logs when connecting without the GnuTLS library (in parallel, so note that logs are duplicated):

# Connect(False)
Status:   FluentFTP 46.0.2.0
Status:   Connecting to IP #1= ***:21

# Connect(False)
Status:   FluentFTP 46.0.2.0
Status:   Connecting to IP #1= ***:21

# Connect(False)
Status:   FluentFTP 46.0.2.0
Status:   Connecting to IP #1= ***:21

# Connect(False)
Status:   FluentFTP 46.0.2.0
Status:   Connecting to IP #1= ***:21

# Connect(False)
Status:   FluentFTP 46.0.2.0
Status:   Connecting to IP #1= ***:21

# Connect(False)
Status:   FluentFTP 46.0.2.0
Status:   Connecting to IP #1= ***:21

# Connect(False)
Status:   FluentFTP 46.0.2.0
Status:   Connecting to IP #1= ***:21

# Connect(False)
Status:   FluentFTP 46.0.2.0
Status:   Connecting to IP #1= ***:21

# Connect(False)
Status:   FluentFTP 46.0.2.0
Status:   Connecting to IP #1= ***:21

# Connect(False)
Status:   FluentFTP 46.0.2.0
Status:   Connecting to IP #1= ***:21
Status:   Waiting for a response
Status:   Waiting for a response
Status:   Waiting for a response
Status:   Waiting for a response
Status:   Waiting for a response
Status:   Waiting for a response
Status:   Waiting for a response
Status:   Waiting for a response
Status:   Waiting for a response
Status:   Waiting for a response
Response: 220-FileZilla Server 1.6.7
Response: 220-FileZilla Server 1.6.7
Response: 220 Please visit https://filezilla-project.org/ [738661,506d]
Response: 220 Please visit https://filezilla-project.org/ [738661,506d]
Status:   Detected FTP server: FileZilla
Status:   Detected FTP server: FileZilla
Command:  AUTH TLS
Command:  AUTH TLS
Status:   Waiting for response to: AUTH TLS
Status:   Waiting for response to: AUTH TLS
Response: 220-FileZilla Server 1.6.7
Response: 220-FileZilla Server 1.6.7
Response: 220-FileZilla Server 1.6.7
Response: 220 Please visit https://filezilla-project.org/ [738661,506d]
Response: 220 Please visit https://filezilla-project.org/ [738661,506d]
Response: 220 Please visit https://filezilla-project.org/ [738661,506d]
Response: 220-FileZilla Server 1.6.7
Response: 220 Please visit https://filezilla-project.org/ [738661,506d]
Status:   Detected FTP server: FileZilla
Status:   Detected FTP server: FileZilla
Status:   Detected FTP server: FileZilla
Status:   Detected FTP server: FileZilla
Command:  AUTH TLS
Command:  AUTH TLS
Command:  AUTH TLS
Command:  AUTH TLS
Response: 220-FileZilla Server 1.6.7
Response: 220 Please visit https://filezilla-project.org/ [738661,506d]
Status:   Detected FTP server: FileZilla
Command:  AUTH TLS
Status:   Waiting for response to: AUTH TLS
Status:   Waiting for response to: AUTH TLS
Status:   Waiting for response to: AUTH TLS
Status:   Waiting for response to: AUTH TLS
Status:   Waiting for response to: AUTH TLS
Response: 220-FileZilla Server 1.6.7
Response: 220 Please visit https://filezilla-project.org/ [738661,506d]
Response: 234 Using authentication type TLS. [21ms]
Response: 234 Using authentication type TLS. [21ms]
Status:   Detected FTP server: FileZilla
Command:  AUTH TLS
Status:   Waiting for response to: AUTH TLS
Response: 220-FileZilla Server 1.6.7
Response: 220-FileZilla Server 1.6.7
Response: 220 Please visit https://filezilla-project.org/ [738661,506d]
Response: 220 Please visit https://filezilla-project.org/ [738661,506d]
Status:   Detected FTP server: FileZilla
Status:   Detected FTP server: FileZilla
Command:  AUTH TLS
Command:  AUTH TLS
Status:   Waiting for response to: AUTH TLS
Status:   Waiting for response to: AUTH TLS
Response: 234 Using authentication type TLS. [25ms]
Response: 234 Using authentication type TLS. [25ms]
Response: 234 Using authentication type TLS. [25ms]
Response: 234 Using authentication type TLS. [25ms]
Response: 234 Using authentication type TLS. [25ms]
Response: 234 Using authentication type TLS. [25ms]
Response: 234 Using authentication type TLS. [26ms]
Response: 234 Using authentication type TLS. [30ms]
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [85ms]
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [85ms]
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [58ms]
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [62ms]
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [62ms]
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [62ms]
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [62ms]
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [62ms]
Command:  USER ***
Command:  USER ***
Command:  USER ***
Command:  USER ***
Command:  USER ***
Command:  USER ***
Command:  USER ***
Command:  USER ***
Status:   Waiting for response to: USER ***
Status:   Waiting for response to: USER ***
Status:   Waiting for response to: USER ***
Status:   Waiting for response to: USER ***
Status:   Waiting for response to: USER ***
Status:   Waiting for response to: USER ***
Status:   Waiting for response to: USER ***
Status:   Waiting for response to: USER ***
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [70ms]
Command:  USER ***
Status:   Waiting for response to: USER ***
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [70ms]
Command:  USER ***
Status:   Waiting for response to: USER ***
Response: 331 Please, specify the password. [39ms]
Response: 331 Please, specify the password. [39ms]
Response: 331 Please, specify the password. [39ms]
Response: 331 Please, specify the password. [35ms]
Response: 331 Please, specify the password. [39ms]
Response: 331 Please, specify the password. [39ms]
Response: 331 Please, specify the password. [39ms]
Response: 331 Please, specify the password. [39ms]
Command:  PASS ***
Command:  PASS ***
Status:   Waiting for response to: PASS ***
Status:   Waiting for response to: PASS ***
Command:  PASS ***
Status:   Waiting for response to: PASS ***
Command:  PASS ***
Command:  PASS ***
Command:  PASS ***
Status:   Waiting for response to: PASS ***
Status:   Waiting for response to: PASS ***
Status:   Waiting for response to: PASS ***
Command:  PASS ***
Command:  PASS ***
Status:   Waiting for response to: PASS ***
Status:   Waiting for response to: PASS ***
Response: 331 Please, specify the password. [36ms]
Command:  PASS ***
Status:   Waiting for response to: PASS ***
Response: 331 Please, specify the password. [39ms]
Command:  PASS ***
Status:   Waiting for response to: PASS ***
Response: 230 Login successful. [764ms]
Response: 230 Login successful. [765ms]
Response: 230 Login successful. [764ms]
Response: 230 Login successful. [765ms]
Response: 230 Login successful. [765ms]
Response: 230 Login successful. [764ms]
Response: 230 Login successful. [764ms]
Response: 230 Login successful. [765ms]
Response: 230 Login successful. [765ms]
Command:  PBSZ 0
Command:  PBSZ 0
Command:  PBSZ 0
Command:  PBSZ 0
Command:  PBSZ 0
Command:  PBSZ 0
Command:  PBSZ 0
Command:  PBSZ 0
Command:  PBSZ 0
Status:   Waiting for response to: PBSZ 0
Status:   Waiting for response to: PBSZ 0
Status:   Waiting for response to: PBSZ 0
Status:   Waiting for response to: PBSZ 0
Status:   Waiting for response to: PBSZ 0
Status:   Waiting for response to: PBSZ 0
Status:   Waiting for response to: PBSZ 0
Status:   Waiting for response to: PBSZ 0
Status:   Waiting for response to: PBSZ 0
Response: 230 Login successful. [768ms]
Command:  PBSZ 0
Status:   Waiting for response to: PBSZ 0
Response: 200 PBSZ=0 [18ms]
Response: 200 PBSZ=0 [18ms]
Command:  PROT P
Command:  PROT P
Status:   Waiting for response to: PROT P
Status:   Waiting for response to: PROT P
Response: 200 PBSZ=0 [21ms]
Response: 200 PBSZ=0 [21ms]
Command:  PROT P
Command:  PROT P
Status:   Waiting for response to: PROT P
Status:   Waiting for response to: PROT P
Response: 200 PBSZ=0 [24ms]
Response: 200 PBSZ=0 [24ms]
Command:  PROT P
Command:  PROT P
Response: 200 PBSZ=0 [24ms]
Status:   Waiting for response to: PROT P
Status:   Waiting for response to: PROT P
Command:  PROT P
Response: 200 PBSZ=0 [23ms]
Response: 200 PBSZ=0 [24ms]
Response: 200 PBSZ=0 [24ms]
Status:   Waiting for response to: PROT P
Command:  PROT P
Command:  PROT P
Command:  PROT P
Status:   Waiting for response to: PROT P
Status:   Waiting for response to: PROT P
Status:   Waiting for response to: PROT P
Response: 200 Protection level set to P [11ms]
Response: 200 Protection level set to P [11ms]
Command:  FEAT
Command:  FEAT
Status:   Waiting for response to: FEAT
Status:   Waiting for response to: FEAT
Response: 200 Protection level set to P [14ms]
Response: 200 Protection level set to P [14ms]
Command:  FEAT
Command:  FEAT
Status:   Waiting for response to: FEAT
Status:   Waiting for response to: FEAT
Response: 200 Protection level set to P [23ms]
Response: 200 Protection level set to P [23ms]
Command:  FEAT
Command:  FEAT
Status:   Waiting for response to: FEAT
Status:   Waiting for response to: FEAT
Response: 200 Protection level set to P [23ms]
Command:  FEAT
Response: 200 Protection level set to P [23ms]
Command:  FEAT
Status:   Waiting for response to: FEAT
Response: 200 Protection level set to P [23ms]
Status:   Waiting for response to: FEAT
Command:  FEAT
Status:   Waiting for response to: FEAT
Response: 200 Protection level set to P [23ms]
Command:  FEAT
Status:   Waiting for response to: FEAT
Response: 211-Features:
Response: MDTM
Response: REST STREAM
Response: SIZE
Response: MLST type*;size*;modify*;perm*;
Response: MLSD
Response: AUTH SSL
Response: AUTH TLS
Response: PROT
Response: PBSZ
Response: UTF8
Response: TVFS
Response: EPSV
Response: EPRT
Response: MFMT
Response: 211 End [17ms]
Response: 211-Features:
Response: MDTM
Response: REST STREAM
Response: SIZE
Response: MLST type*;size*;modify*;perm*;
Response: MLSD
Response: AUTH SSL
Response: AUTH TLS
Response: PROT
Response: PBSZ
Response: UTF8
Response: TVFS
Response: EPSV
Response: EPRT
Response: MFMT
Response: 211 End [17ms]
Response: 211-Features:
Response: MDTM
Response: REST STREAM
Response: SIZE
Response: MLST type*;size*;modify*;perm*;
Response: MLSD
Response: AUTH SSL
Response: AUTH TLS
Response: PROT
Response: PBSZ
Response: UTF8
Response: TVFS
Response: EPSV
Response: EPRT
Response: MFMT
Response: 211 End [13ms]
Response: 211-Features:
Response: MDTM
Response: REST STREAM
Response: SIZE
Response: MLST type*;size*;modify*;perm*;
Response: MLSD
Response: AUTH SSL
Response: AUTH TLS
Response: PROT
Response: PBSZ
Response: UTF8
Response: TVFS
Response: EPSV
Response: EPRT
Response: MFMT
Response: 211 End [13ms]
Status:   Text encoding: System.Text.UTF8Encoding+UTF8EncodingSealed
Status:   Text encoding: System.Text.UTF8Encoding+UTF8EncodingSealed
Status:   Text encoding: System.Text.UTF8Encoding+UTF8EncodingSealed
Status:   Text encoding: System.Text.UTF8Encoding+UTF8EncodingSealed
Command:  OPTS UTF8 ON
Command:  OPTS UTF8 ON
Command:  OPTS UTF8 ON
Command:  OPTS UTF8 ON
Status:   Waiting for response to: OPTS UTF8 ON
Status:   Waiting for response to: OPTS UTF8 ON
Status:   Waiting for response to: OPTS UTF8 ON
Status:   Waiting for response to: OPTS UTF8 ON
Response: 211-Features:
Response: MDTM
Response: REST STREAM
Response: SIZE
Response: MLST type*;size*;modify*;perm*;
Response: MLSD
Response: AUTH SSL
Response: AUTH TLS
Response: PROT
Response: PBSZ
Response: UTF8
Response: TVFS
Response: EPSV
Response: EPRT
Response: MFMT
Response: 211 End [14ms]
Response: 211-Features:
Response: MDTM
Response: REST STREAM
Response: SIZE
Response: MLST type*;size*;modify*;perm*;
Response: MLSD
Response: AUTH SSL
Response: AUTH TLS
Response: PROT
Response: PBSZ
Response: UTF8
Response: TVFS
Response: EPSV
Response: EPRT
Response: MFMT
Response: 211 End [14ms]
Status:   Text encoding: System.Text.UTF8Encoding+UTF8EncodingSealed
Command:  OPTS UTF8 ON
Status:   Text encoding: System.Text.UTF8Encoding+UTF8EncodingSealed
Command:  OPTS UTF8 ON
Status:   Waiting for response to: OPTS UTF8 ON
Status:   Waiting for response to: OPTS UTF8 ON
Response: 211-Features:
Response: MDTM
Response: REST STREAM
Response: SIZE
Response: MLST type*;size*;modify*;perm*;
Response: MLSD
Response: AUTH SSL
Response: AUTH TLS
Response: PROT
Response: PBSZ
Response: UTF8
Response: TVFS
Response: EPSV
Response: EPRT
Response: MFMT
Response: 211-Features:
Response: MDTM
Response: REST STREAM
Response: SIZE
Response: MLST type*;size*;modify*;perm*;
Response: MLSD
Response: AUTH SSL
Response: AUTH TLS
Response: PROT
Response: PBSZ
Response: UTF8
Response: TVFS
Response: EPSV
Response: EPRT
Response: MFMT
Response: 211 End [14ms]
Response: 211 End [14ms]
Response: 211-Features:
Response: MDTM
Response: REST STREAM
Response: SIZE
Response: MLST type*;size*;modify*;perm*;
Response: MLSD
Response: AUTH SSL
Response: AUTH TLS
Response: PROT
Response: PBSZ
Response: UTF8
Response: TVFS
Response: EPSV
Response: EPRT
Response: MFMT
Response: 211 End [14ms]
Status:   Text encoding: System.Text.UTF8Encoding+UTF8EncodingSealed
Status:   Text encoding: System.Text.UTF8Encoding+UTF8EncodingSealed
Command:  OPTS UTF8 ON
Command:  OPTS UTF8 ON
Status:   Text encoding: System.Text.UTF8Encoding+UTF8EncodingSealed
Command:  OPTS UTF8 ON
Status:   Waiting for response to: OPTS UTF8 ON
Status:   Waiting for response to: OPTS UTF8 ON
Status:   Waiting for response to: OPTS UTF8 ON
Response: 211-Features:
Response: MDTM
Response: REST STREAM
Response: SIZE
Response: MLST type*;size*;modify*;perm*;
Response: MLSD
Response: AUTH SSL
Response: AUTH TLS
Response: PROT
Response: PBSZ
Response: UTF8
Response: TVFS
Response: EPSV
Response: EPRT
Response: MFMT
Response: 211 End [14ms]
Status:   Text encoding: System.Text.UTF8Encoding+UTF8EncodingSealed
Command:  OPTS UTF8 ON
Status:   Waiting for response to: OPTS UTF8 ON
Response: 202 UTF8 mode is always enabled. No need to send this command [25ms]
Response: 202 UTF8 mode is always enabled. No need to send this command [25ms]
Response: 202 UTF8 mode is always enabled. No need to send this command [25ms]
Response: 202 UTF8 mode is always enabled. No need to send this command [24ms]
Response: 202 UTF8 mode is always enabled. No need to send this command [32ms]
Response: 202 UTF8 mode is always enabled. No need to send this command [32ms]
Command:  SYST
Command:  SYST
Command:  SYST
Command:  SYST
Command:  SYST
Status:   Waiting for response to: SYST
Status:   Waiting for response to: SYST
Status:   Waiting for response to: SYST
Status:   Waiting for response to: SYST
Command:  SYST
Status:   Waiting for response to: SYST
Response: 202 UTF8 mode is always enabled. No need to send this command [32ms]
Command:  SYST
Status:   Waiting for response to: SYST
Response: 202 UTF8 mode is always enabled. No need to send this command [25ms]
Command:  SYST
Status:   Waiting for response to: SYST
Status:   Waiting for response to: SYST
Response: 202 UTF8 mode is always enabled. No need to send this command [32ms]
Response: 202 UTF8 mode is always enabled. No need to send this command [25ms]
Command:  SYST
Command:  SYST
Status:   Waiting for response to: SYST
Status:   Waiting for response to: SYST
Response: 215 UNIX emulated by FileZilla. [13ms]
Response: 215 UNIX emulated by FileZilla. [13ms]
Response: 215 UNIX emulated by FileZilla. [13ms]
Response: 215 UNIX emulated by FileZilla. [13ms]
Response: 215 UNIX emulated by FileZilla. [13ms]
Response: 215 UNIX emulated by FileZilla. [13ms]
Response: 215 UNIX emulated by FileZilla. [13ms]
Response: 215 UNIX emulated by FileZilla. [14ms]
Response: 215 UNIX emulated by FileZilla. [13ms]
Status:   Listing parser set to: Machine
Status:   Listing parser set to: Machine
Status:   Listing parser set to: Machine
Status:   Listing parser set to: Machine
Status:   Listing parser set to: Machine
Status:   Listing parser set to: Machine
Status:   Listing parser set to: Machine
Status:   Listing parser set to: Machine
Status:   Listing parser set to: Machine
Command:  PWD
Command:  PWD
Status:   Waiting for response to: PWD
Status:   Waiting for response to: PWD
Command:  PWD
Command:  PWD
Command:  PWD
Status:   Waiting for response to: PWD
Command:  PWD
Status:   Waiting for response to: PWD
Status:   Waiting for response to: PWD
Command:  PWD
Status:   Waiting for response to: PWD
Status:   Waiting for response to: PWD
Command:  PWD
Status:   Waiting for response to: PWD
Command:  PWD
Status:   Waiting for response to: PWD
Response: 215 UNIX emulated by FileZilla. [17ms]
Status:   Listing parser set to: Machine
Command:  PWD
Status:   Waiting for response to: PWD
Response: 257 "/" is current directory. [18ms]
Response: 257 "/" is current directory. [23ms]
Response: 257 "/" is current directory. [23ms]
Response: 257 "/" is current directory. [23ms]
Response: 257 "/" is current directory. [23ms]
Response: 257 "/" is current directory. [23ms]
Response: 257 "/" is current directory. [23ms]
Response: 257 "/" is current directory. [23ms]
Response: 257 "/" is current directory. [23ms]



# GetListing("/download", Auto)
# GetListing("/download", Auto)
# GetListing("/download", Auto)

# GetListing("/download", Auto)

# GetListing("/download", Auto)

# GetListing("/download", Auto)

# GetListing("/download", Auto)

# GetListing("/download", Auto)

# GetListing("/download", Auto)
Command:  TYPE I
Command:  TYPE I
Command:  TYPE I
Command:  TYPE I
Command:  TYPE I
Command:  TYPE I
Command:  TYPE I
Command:  TYPE I
Command:  TYPE I
Status:   Waiting for response to: TYPE I
Status:   Waiting for response to: TYPE I
Status:   Waiting for response to: TYPE I
Status:   Waiting for response to: TYPE I
Status:   Waiting for response to: TYPE I
Status:   Waiting for response to: TYPE I
Status:   Waiting for response to: TYPE I
Status:   Waiting for response to: TYPE I
Status:   Waiting for response to: TYPE I
Response: 257 "/" is current directory. [47ms]

# GetListing("/download", Auto)
Command:  TYPE I
Status:   Waiting for response to: TYPE I
Response: 200 Type set to I [15ms]
Response: 200 Type set to I [15ms]
Response: 200 Type set to I [15ms]
Response: 200 Type set to I [15ms]
Response: 200 Type set to I [15ms]
Response: 200 Type set to I [15ms]
Response: 200 Type set to I [15ms]
Response: 200 Type set to I [15ms]
Response: 200 Type set to I [15ms]




# OpenDataStreamAsync("MLSD /download", 0)
# OpenDataStreamAsync("MLSD /download", 0)
# OpenDataStreamAsync("MLSD /download", 0)

# OpenDataStreamAsync("MLSD /download", 0)

# OpenDataStreamAsync("MLSD /download", 0)
# OpenDataStreamAsync("MLSD /download", 0)


# OpenDataStreamAsync("MLSD /download", 0)
# OpenDataStreamAsync("MLSD /download", 0)

# OpenDataStreamAsync("MLSD /download", 0)

# OpenPassiveDataStreamAsync(AutoPassive, "MLSD /download", 0)

# OpenPassiveDataStreamAsync(AutoPassive, "MLSD /download", 0)
Command:  EPSV
Command:  EPSV

# OpenPassiveDataStreamAsync(AutoPassive, "MLSD /download", 0)
Status:   Waiting for response to: EPSV
Status:   Waiting for response to: EPSV
Command:  EPSV
Status:   Waiting for response to: EPSV


# OpenPassiveDataStreamAsync(AutoPassive, "MLSD /download", 0)
# OpenPassiveDataStreamAsync(AutoPassive, "MLSD /download", 0)

# OpenPassiveDataStreamAsync(AutoPassive, "MLSD /download", 0)
Command:  EPSV
Command:  EPSV
Command:  EPSV
Status:   Waiting for response to: EPSV
Status:   Waiting for response to: EPSV
Status:   Waiting for response to: EPSV

# OpenPassiveDataStreamAsync(AutoPassive, "MLSD /download", 0)
Command:  EPSV
Status:   Waiting for response to: EPSV

# OpenPassiveDataStreamAsync(AutoPassive, "MLSD /download", 0)
Command:  EPSV
Status:   Waiting for response to: EPSV

# OpenPassiveDataStreamAsync(AutoPassive, "MLSD /download", 0)
Command:  EPSV
Status:   Waiting for response to: EPSV
Response: 200 Type set to I [26ms]

# OpenDataStreamAsync("MLSD /download", 0)

# OpenPassiveDataStreamAsync(AutoPassive, "MLSD /download", 0)
Command:  EPSV
Status:   Waiting for response to: EPSV
Response: 229 Entering Extended Passive Mode (|||7012|) [21ms]
Response: 229 Entering Extended Passive Mode (|||7013|) [22ms]
Response: 229 Entering Extended Passive Mode (|||7003|) [22ms]
Response: 229 Entering Extended Passive Mode (|||7008|) [21ms]
Response: 229 Entering Extended Passive Mode (|||7011|) [22ms]
Response: 229 Entering Extended Passive Mode (|||7014|) [22ms]
Response: 229 Entering Extended Passive Mode (|||7009|) [22ms]
Response: 229 Entering Extended Passive Mode (|||7010|) [22ms]
Response: 229 Entering Extended Passive Mode (|||7001|) [21ms]
Status:   Connecting to IP #1= ***:7014
Status:   Connecting to IP #1= ***:7010
Status:   Connecting to IP #1= ***:7011
Status:   Connecting to IP #1= ***:7008
Status:   Connecting to IP #1= ***:7013
Status:   Connecting to IP #1= ***:7003
Status:   Connecting to IP #1= ***:7001
Status:   Connecting to IP #1= ***:7012
Status:   Connecting to IP #1= ***:7009
Response: 229 Entering Extended Passive Mode (|||7004|) [23ms]
Status:   Connecting to IP #1= ***:7004
Command:  MLSD /download
Status:   Waiting for response to: MLSD /download
Command:  MLSD /download
Command:  MLSD /download
Command:  MLSD /download
Command:  MLSD /download
Status:   Waiting for response to: MLSD /download
Status:   Waiting for response to: MLSD /download
Status:   Waiting for response to: MLSD /download
Status:   Waiting for response to: MLSD /download
Command:  MLSD /download
Status:   Waiting for response to: MLSD /download
Command:  MLSD /download
Status:   Waiting for response to: MLSD /download
Command:  MLSD /download
Status:   Waiting for response to: MLSD /download
Command:  MLSD /download
Status:   Waiting for response to: MLSD /download
Command:  MLSD /download
Status:   Waiting for response to: MLSD /download
Response: 150 About to start data transfer. [16ms]
Response: 150 Starting data transfer. [34ms]
Response: 150 Starting data transfer. [33ms]
Response: 150 Starting data transfer. [33ms]
Response: 150 Starting data transfer. [33ms]
Response: 150 Starting data transfer. [34ms]
Response: 150 Starting data transfer. [34ms]
Response: 150 Starting data transfer. [34ms]
Response: 150 Starting data transfer. [33ms]
Response: 150 Starting data transfer. [34ms]
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [24ms]
+---------------------------------------+
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [50ms]
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [50ms]
+---------------------------------------+
+---------------------------------------+
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [50ms]
+---------------------------------------+
-----------------------------------------
-----------------------------------------
-----------------------------------------
Status:   Closing/Disposing FtpSocketStream(data connection)
Status:   Closing/Disposing FtpSocketStream(data connection)
Status:   Closing/Disposing FtpSocketStream(data connection)

# CloseDataStream()

# CloseDataStream()

# CloseDataStream()
Status:   Waiting for response to: MLSD /download
Status:   Waiting for response to: MLSD /download
Status:   Waiting for response to: MLSD /download
Response: 425 Unable to build data connection: TLS session of data connection not resumed. [92ms]
Response: 425 Unable to build data connection: TLS session of data connection not resumed. [92ms]
Response: 425 Unable to build data connection: TLS session of data connection not resumed. [92ms]
Status:   Closing/Disposing FtpSocketStream(data connection)
Status:   Closing/Disposing FtpSocketStream(data connection)
Status:   Closing/Disposing FtpSocketStream(data connection)
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [216ms]
+---------------------------------------+
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [215ms]
+---------------------------------------+
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [216ms]
+---------------------------------------+
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [216ms]
+---------------------------------------+
-----------------------------------------
-----------------------------------------
-----------------------------------------
Status:   Closing/Disposing FtpSocketStream(data connection)
Status:   Closing/Disposing FtpSocketStream(data connection)
Status:   Closing/Disposing FtpSocketStream(data connection)
-----------------------------------------
Status:   Closing/Disposing FtpSocketStream(data connection)
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [216ms]
+---------------------------------------+
-----------------------------------------
Status:   Closing/Disposing FtpSocketStream(data connection)

# CloseDataStream()

# CloseDataStream()
Status:   Waiting for response to: MLSD /download
Status:   Waiting for response to: MLSD /download
Response: 425 Unable to build data connection: TLS session of data connection not resumed. [251ms]
Response: 425 Unable to build data connection: TLS session of data connection not resumed. [250ms]
Status:   FTPS authentication successful, lib = .NET SslStream, cipher suite =  [240ms]
+---------------------------------------+
-----------------------------------------
Status:   Closing/Disposing FtpSocketStream(data connection)

# CloseDataStream()
Status:   Closing/Disposing FtpSocketStream(data connection)
Status:   Waiting for response to: MLSD /download
Status:   Closing/Disposing FtpSocketStream(data connection)
Response: 425 Unable to build data connection: TLS session of data connection not resumed. [251ms]
Status:   Closing/Disposing FtpSocketStream(data connection)

# CloseDataStream()
Status:   Waiting for response to: MLSD /download

# CloseDataStream()
Status:   Waiting for response to: MLSD /download

# CloseDataStream()
Status:   Waiting for response to: MLSD /download
Response: 425 Unable to build data connection: TLS session of data connection not resumed. [251ms]
Response: 425 Unable to build data connection: TLS session of data connection not resumed. [257ms]
Status:   Closing/Disposing FtpSocketStream(data connection)
Status:   Closing/Disposing FtpSocketStream(data connection)
Response: 425 Unable to build data connection: TLS session of data connection not resumed. [251ms]
Status:   Closing/Disposing FtpSocketStream(data connection)
-----------------------------------------
Status:   Closing/Disposing FtpSocketStream(data connection)

# CloseDataStream()
Status:   Waiting for response to: MLSD /download
Response: 226 Operation successful [324ms]
Status:   Closing/Disposing FtpSocketStream(data connection)

Logs when connecting with GnuTls (without parallellization):

# Connect(False)
Status:   FluentFTP 46.0.2.0
Status:   Connecting to IP #1= ***:21
Status:   Waiting for a response
Response: 220-FileZilla Server 1.6.7
Response: 220 Please visit https://filezilla-project.org/ [738661,508d]
Status:   Detected FTP server: FileZilla
Command:  AUTH TLS
Status:   Waiting for response to: AUTH TLS
Response: 234 Using authentication type TLS. [20ms]
Status:   GnuTLS: 0   FluentFTP.GnuTLS 1.0.11.0(Win32NT/.NET Standard 2.1) / GnuTLS 3.7.8
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=P2SRootCert.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: OU=Copyright (c) 1997 Microsoft Corp.,OU=Microsoft Corporation,CN=Microsoft Root Authority.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: C=US,O=MSFT,CN=Microsoft Authenticode(tm) Root Authority.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 1   Internal: There was a non-CA certificate in the trusted list: CN=Root Agency.
Status:   GnuTLS: 0   Error   : *GnuTlsHandShake(...) failed: (-110) GNUTLS_E_PREMATURE_TERMINATION
Status:   GnuTLS: 0   Debug   : Last 150 GnuTLS buffered debug messages follow:
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=P2SRootCert.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: OU=Copyright (c) 1997 Microsoft Corp.,OU=Microsoft Corporation,CN=Microsoft Root Authority.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: C=US,O=MSFT,CN=Microsoft Authenticode(tm) Root Authority.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: common.c[_gnutls_x509_get_raw_field2]:1569
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: x509.c[gnutls_x509_crt_get_subject_unique_id]:4099
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: x509.c[gnutls_x509_crt_get_issuer_unique_id]:4149
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: common.c[_gnutls_x509_get_raw_field2]:1569
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: x509.c[gnutls_x509_crt_get_subject_unique_id]:4099
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: x509.c[gnutls_x509_crt_get_issuer_unique_id]:4149
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=localhost.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: common.c[_gnutls_x509_get_raw_field2]:1569
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: x509.c[gnutls_x509_crt_get_subject_unique_id]:4099
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: x509.c[gnutls_x509_crt_get_issuer_unique_id]:4149
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: verify-high.c[gnutls_x509_trust_list_add_cas]:407
Status:   GnuTLS: 0   Debug   : 1   Internal: There was a non-CA certificate in the trusted list: CN=Root Agency.
Status:   GnuTLS: 0   Debug   : 5   Internal: REC[000001da6b310600]: Allocating epoch #0
Status:   GnuTLS: 0   Debug   : 2   Internal: added 6 protocols, 29 ciphersuites, 19 sig algos and 10 groups into priority list
Status:   GnuTLS: 0   Debug   : 5   Internal: REC[000001da6b310600]: Allocating epoch #1
Status:   GnuTLS: 0   Debug   : 4   Internal: HSK[000001da6b310600]: Adv. version: 3.3
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (OCSP Status Request/5) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sending extension OCSP Status Request/5 (5 bytes)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Client Certificate Type/19) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Server Certificate Type/20) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Supported Groups/10) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sent group SECP256R1 (0x17)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sent group SECP384R1 (0x18)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sent group SECP521R1 (0x19)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sent group X25519 (0x1d)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sent group X448 (0x1e)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sent group FFDHE2048 (0x100)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sent group FFDHE3072 (0x101)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sent group FFDHE4096 (0x102)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sent group FFDHE6144 (0x103)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sent group FFDHE8192 (0x104)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sending extension Supported Groups/10 (22 bytes)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Supported EC Point Formats/11) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sending extension Supported EC Point Formats/11 (2 bytes)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Signature Algorithms/13) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sent signature algo (4.1) RSA-SHA256
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sent signature algo (8.9) RSA-PSS-SHA256
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sent signature algo (8.4) RSA-PSS-RSAE-SHA256
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sent signature algo (4.3) ECDSA-SHA256
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sent signature algo (8.7) EdDSA-Ed25519
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sent signature algo (5.1) RSA-SHA384
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sent signature algo (8.10) RSA-PSS-SHA384
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sent signature algo (8.5) RSA-PSS-RSAE-SHA384
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sent signature algo (5.3) ECDSA-SHA384
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sent signature algo (8.8) EdDSA-Ed448
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sent signature algo (6.1) RSA-SHA512
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sent signature algo (8.11) RSA-PSS-SHA512
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sent signature algo (8.6) RSA-PSS-RSAE-SHA512
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sent signature algo (6.3) ECDSA-SHA512
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sent signature algo (2.1) RSA-SHA1
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sent signature algo (2.3) ECDSA-SHA1
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sending extension Signature Algorithms/13 (34 bytes)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (ALPN/16) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sending extension ALPN/16 (7 bytes)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Encrypt-then-MAC/22) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sending extension Encrypt-then-MAC/22 (0 bytes)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Extended Master Secret/23) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sending extension Extended Master Secret/23 (0 bytes)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Session Ticket/35) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sending extension Session Ticket/35 (0 bytes)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Key Share/51) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sending key share for SECP256R1
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: sending key share for X25519
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sending extension Key Share/51 (107 bytes)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Supported Versions/43) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sending extension Supported Versions/43 (9 bytes)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Post Handshake Auth/49) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Safe Renegotiation/65281) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sending extension Safe Renegotiation/65281 (1 bytes)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Server Name Indication/0) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Cookie/44) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Early Data/42) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (PSK Key Exchange Modes/45) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sending extension PSK Key Exchange Modes/45 (3 bytes)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Record Size Limit/28) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Sending extension Record Size Limit/28 (2 bytes)
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Maximum Record Size/1) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Compress Certificate/27) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (ClientHello Padding/21) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: EXT[000001da6b310600]: Preparing extension (Pre Shared Key/41) for 'client hello'
Status:   GnuTLS: 0   Debug   : 4   Internal: HSK[000001da6b310600]: CLIENT HELLO was queued [379 bytes]
Status:   GnuTLS: 0   Debug   : 11  Internal: HWRITE: enqueued [CLIENT HELLO] 379. Total 379 bytes.
Status:   GnuTLS: 0   Debug   : 11  Internal: HWRITE FLUSH: 379 bytes in buffer.
Status:   GnuTLS: 0   Debug   : 5   Internal: REC[000001da6b310600]: Preparing Packet Handshake(22) with length: 379 and min pad: 0
Status:   GnuTLS: 0   Debug   : 9   Internal: ENC[000001da6b310600]: cipher: NULL, MAC: MAC-NULL, Epoch: 0
Status:   GnuTLS: 0   Debug   : 11  Internal: WRITE: enqueued 384 bytes for 0000000000000658. Total 384 bytes.
Status:   GnuTLS: 0   Debug   : 5   Internal: REC[000001da6b310600]: Sent Packet[1] Handshake(22) in epoch 0 and length: 384
Status:   GnuTLS: 0   Debug   : 11  Internal: HWRITE: wrote 1 bytes, 0 bytes left.
Status:   GnuTLS: 0   Debug   : 11  Internal: WRITE FLUSH: 384 bytes in buffer.
Status:   GnuTLS: 0   Debug   : 11  Internal: WRITE: wrote 384 bytes, 0 bytes left.
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: buffers.c[get_last_packet]:1185
Status:   GnuTLS: 0   Debug   : 10  Internal: READ: Got 0 bytes from 0000000000000658
Status:   GnuTLS: 0   Debug   : 10  Internal: READ: read 0 bytes from 0000000000000658
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: buffers.c[_gnutls_io_read_buffered]:593
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: record.c[recv_headers]:1195
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: record.c[_gnutls_recv_in_buffers]:1321
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: buffers.c[_gnutls_handshake_io_recv_int]:1467
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: handshake.c[_gnutls_recv_handshake]:1600
Status:   GnuTLS: 0   Debug   : 3   Internal: ASSERT: handshake.c[handshake_client]:3075
Status:   GnuTLS: 0   Debug   : 13  Internal: BUF[HSK]: Emptied buffer
Status:   Closing/Disposing FtpSocketStream(control connection)
Error:    FTPS Authentication failed, lib = FluentFTP.GnuTLS.GnuTlsStream
Error:    Error   : *GnuTlsHandShake(...) failed: (-110) GNUTLS_E_PREMATURE_TERMINATION

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 21

Most upvoted comments

I will check next time when I touch the packaging.

Simplified client wrapper

internal class CasFtpClient : ICasFtpClient 
{
      internal IAsyncFtpClient ftpClient;
      internal IRetryStrategy retryStrategy;

      public CasFtpClient(
          IAsyncFtpClient ftpClient,
          IRetryStrategy retryStrategy)
      {
          this.ftpClient = ftpClient;
          this.retryStrategy = retryStrategy;
      }
      public void Dispose()
      {
          retryStrategy.ExecuteWithRetries(() => ftpClient.Dispose());
      }

      public Task ConnectAsync(CancellationToken cancellationToken = default)
      {
          if (ftpClient.IsConnected)
          {
              return Task.CompletedTask;
          }

          return retryStrategy.ExecuteWithRetriesAsync(() => ftpClient.Connect(cancellationToken), cancellationToken);
      }

      public async Task<IEnumerable<FtpFile>> ListDirectoryAsync(string downloadFolder, CancellationToken cancellationToken = default)
      {
          var result = await retryStrategy
              .ExecuteWithRetriesAsync(() => ftpClient.GetListing(downloadFolder, cancellationToken), cancellationToken)
              .ConfigureAwait(false);

          return result.Select(x => new FtpFile
          {
              IsRegularFile = x.Type == FtpObjectType.File,
              Name = x.Name,
              FullPath = x.FullName
          });
      }
}

Factory

public ICasFtpClient Create(FtpCredentials credentials)
{
    if (credentials.ProxyType != FtpProxyTypes.None)
    {
        throw new NotSupportedException("Using a proxy is not yet supported for FTP.");
    }

    var retryStrategy = serviceProvider.GetRequiredService<IRetryStrategy>();

    var encryptionMode = credentials.Protocol == FtpProtocol.Ftp ? FtpEncryptionMode.None : FtpEncryptionMode.Explicit;
    var validateAnyCertificate = !(credentials.ValidateCertificate ?? true);
    var networkCredential = new NetworkCredential(credentials.User, credentials.Password);
    var connectionType = credentials.UsePassive.GetValueOrDefault() ? FtpDataConnectionType.PASV : default;

    var ftpConfig = new FtpConfig
    {
        EncryptionMode = encryptionMode,
        ValidateAnyCertificate = validateAnyCertificate,
        DataConnectionType = connectionType
    };

    if (credentials.Protocol == FtpProtocol.Ftps && credentials.UseGnuTlsForFtps)
    {
        ftpConfig.CustomStream = typeof(GnuTlsStream);

        var gnuConfig = new GnuConfig();

        if (credentials.GnuTlsDisableAlpn)
        {
            gnuConfig.SetALPNDataConnection = string.Empty;
            gnuConfig.SetALPNControlConnection = string.Empty;
        }

        ftpConfig.CustomStreamConfig = gnuConfig;
    }

    if (credentials.Timeout.HasValue)
    {
        var milliseconds = (int)credentials.Timeout.Value.TotalMilliseconds;

        ftpConfig.ConnectTimeout = milliseconds;
        ftpConfig.DataConnectionConnectTimeout = milliseconds;
        ftpConfig.ReadTimeout = milliseconds;
        ftpConfig.DataConnectionReadTimeout = milliseconds;
    }

    var ftpClient = new AsyncFtpClient(credentials.Host, networkCredential, credentials.Port.GetValueOrDefault(0), ftpConfig);
    return new CasFtpClient(ftpClient, retryStrategy);
}

Test

[Test]
public async Task Then_we_should_be_able_to_connect_and_list_files_sequentially()
{
    var factory = services.GetRequiredService<ICreateCasFtpClients>();

    for (var i = 0; i < NumberOfAttempts; i++)
    {
        using (var client = factory.Create(new FtpCredentials
        {
            Host = "xxx",
            User = "xxx",
            Password = "xxx",
            Protocol = FtpProtocol.Ftps,
            ValidateCertificate = false,
            UseGnuTlsForFtps = true,
            GnuTlsDisableAlpn = true
        }))
        {


            await client.ConnectAsync();

            var result = await client.ListDirectoryAsync("/download");
            result.Should().NotBeNull();
        }
    }
}

Moving this to a new issue. Closing this one.

Ok, I can confirm your problem. In a loop, we get a crash. I will investigate.

when I pack an internal NuGet package that has FluentFTP.GnuTLS as a dependency

I had a fine time putting together the .csproj for FluentFTP.GnuTLS so that its libs are placed in the right directory when installing it as a Nuget for a normal project.

You say you are then creating a Nuget yourself? Well, look at our .csproj and you can see the hoops we had to run through to make that work.

Making it thread safe - well, I’ll put that on the list. After getting it to work under Linux, which was the last big thing that was done, I suppose one could investigate what this would entail.

Is it possible that the FluentFTP.GnuTLS library is not thread safe?

I definitely would say that, too. This has never been addressed up to now. The entire development of FluentFTP.GnuTLS was geared towads having an initial alternative to the TLS1.3 and Session Resume problems of .NET SslStream.

First of all, there is a workaround in case you are in a real hurry:

Using the config options, set “%NO_EXTENSIONS”.

Like so:

				SecurityProfile = GnuProfile.None,
				AdvancedOptions = new List<GnuAdvanced> {
						GnuAdvanced.NoExtensions,
					},

This will cause GnuTLS to ignore the sent ALPN strings. It will drop you down to TLS1.2 also, but session resume will work.

But by tomorrow morning there will be a new release fixing this problem.

You will need to specifiy:

				SetALPNControlConnection = string.Empty,
				SetALPNDataConnection = string.Empty,

as config options instead. You won’t be dropped down to TLS.12.

The new release will 1.0.12.