title: System.Net.FtpClient with SSL\TLS - Timed out trying to connect
body: <p>I'm made a setup of FTP server (based on ubuntu\vsftpd).</p>
  
  <p>I'm connecting this ftp server from the internet, so I'm activated the SSL security feature in the server.</p>
  
  <p>In order to check that everything is OK, I'm made a test with FileZiLla -> it's working.
  Log (from FileZilla):</p>
  
  <pre><code>Status: Connecting to ****:21...
  Status: Connection established, waiting for welcome message...
  Response:   220 (vsFTPd 3.0.2)
  Command:    AUTH TLS
  Response:   234 Proceed with negotiation.
  Status: Initializing TLS...
  Status: Verifying certificate...
  Command:    USER ****
  Status: TLS/SSL connection established.
  Response:   331 Please specify the password.
  Command:    PASS ********
  Response:   230 Login successful.
  Command:    SYST
  Response:   215 UNIX Type: L8
  Command:    FEAT
  Response:   211-Features:
  Response:    AUTH SSL
  Response:    AUTH TLS
  Response:    EPRT
  Response:    EPSV
  Response:    MDTM
  Response:    PASV
  Response:    PBSZ
  Response:    PROT
  Response:    REST STREAM
  Response:    SIZE
  Response:    TVFS
  Response:    UTF8
  Response:   211 End
  Command:    OPTS UTF8 ON
  Response:   200 Always in UTF8 mode.
  Command:    PBSZ 0
  Response:   200 PBSZ set to 0.
  Command:    PROT P
  Response:   200 PROT now Private.
  Status: Connected
  Status: Retrieving directory listing...
  Command:    PWD
  Response:   257 "/home/****"
  Command:    TYPE I
  Response:   200 Switching to Binary mode.
  Command:    PASV
  Response:   227 Entering Passive Mode (*,*,*,*,*,*).
  Command:    LIST
  Response:   150 Here comes the directory listing.
  Response:   226 Directory send OK.
  Status: Directory listing successful
  </code></pre>
  
  <p>Going back to my C# code...
  I'm trying to connect my server with the following code, which based on <a href="https://netftp.codeplex.com/" rel="nofollow">System.Net.FtpClient</a>:</p>
  
  <pre><code>public PageDownloader()
          {
              this.Client = new FtpClient();
              this.Client.Host = FTP_HOST;
              this.Client.Port = 21;
              this.Client.Credentials = new NetworkCredential(FTP_USER, FTP_PASS);
              this.Client.DataConnectionType = FtpDataConnectionType.PASV;
              this.Client.EncryptionMode = FtpEncryptionMode.Explicit;
              this.Client.ValidateCertificate += Client_ValidateCertificate;
              this.Client.Connect(); // Exception- System.TimeoutException: Timed out trying to connect!
          }
  
          void Client_ValidateCertificate(FtpClient control, FtpSslValidationEventArgs e)
          {
              // Never rich here
              e.Accept = true; // Allow all - just for testing...
          }
  </code></pre>
  
  <p>I'm got this exception:</p>
  
  <blockquote>
    <p>System.TimeoutException: Timed out trying to connect!    at
    System.Net.FtpClient.FtpSocketStream.Connect(String host, Int32 port,
    FtpIpVersion ipVersions)    at
    System.Net.FtpClient.FtpClient.Connect()</p>
  </blockquote>
  
  <p>Someone know why it's happen? Why I'm should check? </p>