0

I am using this code to attempt to establish a FTP connection to a Windows FTP Service

FtpClient client = new FtpClient(ip, user, password);
client.ConnectTimeout = 600000;
client.ReadTimeout = 60000;
client.EncryptionMode = FtpEncryptionMode.Implicit;
client.SslProtocols = System.Security.Authentication.SslProtocols.Tls;
client.DataConnectionType = FluentFTP.FtpDataConnectionType.PASV;
client.ValidateAnyCertificate = true;

client.Connect();

In a windows machine, the connection is stablished correctly, but from my Ubuntu machine it cannot be established, i always get the error

"error:141E70BF:SSL routines:tls_construct_client_hello:no protocols available"

How can i make this work ?

============= UPDATE

I tried the AutoDetect method of the FTPClient but the method does not retrieve any profile

Also the AutoConnect method seems to connect but when i try to get the listing of a folder an error arises that the profiles requires SSL

When i enable the tracing for the client i get this output in the log:

# Connect()
Status:   Connecting to server:21
Response: 220-Microsoft FTP Service
Response: 220 ************************************************************
Status:   Detected FTP server: WindowsServerIIS
Command:  AUTH TLS
Response: 234 AUTH command ok. Expecting TLS Negotiation.
Status:   Disposing FtpSocketStream...
Error:    FTPS Authentication Failed
                                    
jmiguel77
  • 824
  • 9
  • 19

1 Answers1

0

I just figured out how to make this work following instructions from this post:

OpenSSL v1.1.1 Ubuntu 20 TLSv1 - no protocols available

and this other one

https://askubuntu.com/questions/1233186/ubuntu-20-04-how-to-set-lower-ssl-security-level

in my case, the server i am targeting seems to be very old, the nmap output is something like this:

21/tcp open  ftp
| ssl-enum-ciphers: 
|   SSLv3: 
|     ciphers: 
|       TLS_RSA_WITH_3DES_EDE_CBC_SHA (rsa 2048) - C
|       TLS_RSA_WITH_RC4_128_SHA (rsa 2048) - C
|       TLS_RSA_WITH_RC4_128_MD5 (rsa 2048) - C
|     compressors: 
|       NULL
|     cipher preference: server
|   TLSv1.0: 
|     ciphers: 
|       TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (secp256r1) - A
|       TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (secp256r1) - A
|       TLS_RSA_WITH_AES_256_CBC_SHA (rsa 2048) - A
|       TLS_RSA_WITH_AES_128_CBC_SHA (rsa 2048) - A
|       TLS_RSA_WITH_3DES_EDE_CBC_SHA (rsa 2048) - C
|       TLS_RSA_WITH_RC4_128_SHA (rsa 2048) - C
|       TLS_RSA_WITH_RC4_128_MD5 (rsa 2048) - C
|     compressors: 
|       NULL
|     cipher preference: server
|     warnings: 
|       64-bit block cipher 3DES vulnerable to SWEET32 attack
|       Broken cipher RC4 is deprecated by RFC 7465
|       Ciphersuite uses MD5 for message integrity
|       Weak certificate signature: SHA1
|_  least strength: C 

I had to configure openssl to use TLSv1 which is pretty much deprecated now

jmiguel77
  • 824
  • 9
  • 19