title: Send file FTP over SSL with custom port number
body: <p>I want to upload and download a file to FTP over ssl with custom port number or FTP with implicit SSL.
  I am using .net ftpwebrequest &amp; ftpwebresponse method for this.
  here is my code:</p>
  
  <pre><code>Dim reqObj As FtpWebRequest = CType(WebRequest.Create(_Url + filename), FtpWebRequest) 
  reqObj.Method = WebRequestMethods.Ftp.UploadFile 
  reqObj.KeepAlive = False 
  If _IsSSLEnable Then 
  reqObj.UseBinary = True 
  End If 
  reqObj.Credentials = New NetworkCredential(_UserName, _Password) 
  If _IsSSLEnable Then 
  reqObj.EnableSsl = _IsSSLEnable Net.ServicePointManager.ServerCertificateValidationCallback = AddressOf validateCert  
  End If 
  Dim streamResponse As Stream 
  streamResponse = reqObj.GetRequestStream() 
  </code></pre>
  
  <p>I am getting error after this...</p>
  
  <p>The server returned an address in response to the PASV command that is different than the address to which the FTP connection was made.</p>
  
  <p>But if i Add </p>
  
  <pre><code>reqObj.UsePassive = False
  </code></pre>
  
  <p>It gives me error:</p>
  
  <blockquote>
    <p>The operation has timed out</p>
  </blockquote>
  
  <p>this is working fine for normal ftp and ftp over ssl  but not for custom port number or implicit ssl.</p>
  
  <p>Can you please tell me does .net support this?</p>
  
  <p>Or I have to use other method for this case</p>
  
  <p>Thanks,</p>
  
  <p>Hemant</p>