EvotecIT / Transferetto

Small PowerShell module with FTPS/SFTP functionality
MIT License
55 stars 14 forks source link

Code: 522 Message: SSL connection failed; session reuse required: see require_ssl_reuse option in vsftpd.conf man page #39

Open DeeTigIT opened 7 months ago

DeeTigIT commented 7 months ago

I'm doing some PowerShell testing with Transferetto against 2 public FTPS sites:

Cmdlets I use: $Client = Connect-FTP -Server $Server -Port $Port -Credential $PSCredential -AutoConnect -ValidateAnyCertificate -ErrorAction Stop $Files = Get-FTPList -Client $Client -Path $SourceFolder -ErrorAction Stop

With both sites the Connect-FTP is succesful (IsConnected : True, SslProtocolActive : Tls12). Rebex also returns a file list. But Get-FTPList returns an error for dlptest:

WARNING: Get-FTPList - Error: Exception calling "GetListing" with "1" argument(s): "Code: 522 Message: SSL connection failed; session reuse required: see require_ssl_reuse option in vsftpd.conf man page"

I found the page: https://github.com/robinrodricks/FluentFTP/issues/1283 which says: Thank you so much, this worked. I installed the FluentFTP.GnuTLS package and just added this. client.Config.CustomStream = typeof(GnuTlsStream);

Now, FluentFTP.GnuTLS.dll is included with Transferetto. So, why does this error occur? Does this imply that all sites using the default YES for require_ssl_reuse ( https://linux.die.net/man/5/vsftpd.conf ) can't be fully handled with Transferetto? Assuming rebex uses NO and dlptest uses default YES (but I don't know how to check this).

I also found the page https://github.com/robinrodricks/FluentFTP/wiki/FTPS-Connection-using-GnuTLS where GnuTLS is mentioned in combination with TLS 1.3. If the public sites don't have TLS 1.3, could that be an explanation for the error?

PrzemyslawKlys commented 7 months ago

Maybe that's misconfiguration on my part as I am not doing client.Config.CustomStream = xxx so maybe it needs further changes