title: Upload file to implicit FTPS server in C# with TLS session reuse
body: <p>I'm trying to upload file to FileZilla server through ftps by protocol TLS. On the server port 20 and 21 is closed. The only way how I managed to connect to server is by using FluentFTP but I couldn't upload file because of some FileZilla server bug.</p>
  
  <p><a href="https://github.com/robinrodricks/FluentFTP/issues/335" rel="noreferrer">https://github.com/robinrodricks/FluentFTP/issues/335</a><br>
  <a href="https://forum.filezilla-project.org/viewtopic.php?t=51601" rel="noreferrer">https://forum.filezilla-project.org/viewtopic.php?t=51601</a><br></p>
  
  <pre><code>public static void UploadTest(
      string pathUploadFile, string addressIP, int port, string location,
      string userName, string password)
  {
      FtpClient ftp;
  
      Console.WriteLine("Configuring FTP to Connect to {0}", addressIP);
      ftp = new FtpClient(addressIP, port, new NetworkCredential(userName, password));
      ftp.ConnectTimeout = 600000;
      ftp.ReadTimeout = 60000;
      ftp.EncryptionMode = FtpEncryptionMode.Implicit;
      ftp.SslProtocols = SslProtocols.Default | SslProtocols.Tls11 | SslProtocols.Tls12;
      ftp.ValidateCertificate += new FtpSslValidation(OnValidateCertificate);
      ftp.Connect();
      // upload a file
      ftp.UploadFile(pathUploadFile, location);
  
      Console.WriteLine("Connected to {0}", addressIP);
      ftp.Disconnect();
  
      void OnValidateCertificate(FtpClient control, FtpSslValidationEventArgs e)
      {
          // add logic to test if certificate is valid here
          e.Accept = true;
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/3VFMA.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/3VFMA.jpg" alt="enter image description here"></a></p>
  
  <p>Is there any way around without a violating security level? If not is there any other free library which support uploading files with TLS/SSL? I also tried this but it didn't work.<br>
  <a href="https://docs.microsoft.com/en-us/dotnet/api/system.net.ftpwebrequest.enablessl" rel="noreferrer">https://docs.microsoft.com/en-us/dotnet/api/system.net.ftpwebrequest.enablessl</a></p>
  
  <p>Thanks.</p>