.net - FTPWebRequest behind NAT (PASV,SSL) -
Has anyone used FTP ftps on a remote server behind a NAT Net FTPWebRequest class? My code is as follows:
dim URI = "ftp: //" & amp; SRemoteDir & amp; "/" FtpWebRequest = as a dim feet, nothing is resolved servicepoint manager. ServerCertificateValidationCallback = Addressed Valid Certificate FTP = CType (FtpWebRequest.Create (URI), FtpWebRequest) FTP. Cash Policy = New System.Net.Cache.RequestCachePolicy (System.Net.Cache.RequestCacheLevel NoCacheNoStore) ftp.Credentials = New NetworkCredential (sUID, sPw) ftp.EnableSsl = True ftp.Method = WebRequestMethods.Ftp.ListDirectoryDetailsFtpWebResponse = CType Retarded reaction in form (ftp.GetResponse (), FtpWebResponse) Response = Response in the form of stream response. Dim Stream Reader (responses) as GETResponseStream New Stream Reader Dim SB New StringBuilder () sb.Append (streamReader.ReadToEnd) as streamReader.Close () Response Turn off () return sb.ToString () Expiration Return (ex.
and I get the following exception:
< P> I know the code is good, because it works There is no idea behind the NIN one NAT? The machine has a static IP and all ports are open for traffic from specified ports."Reading data from the transport connection Unable to: A connection attempt failed because the connected party did not respond properly after a period of time, or the installed connection failed because the connect failed to respond to the host. "
Hard to actually say without setting up your firewall or FTP server, but on an estimate - you need to see how the server is set up to use passive mode. With the use of the file district, the most popular Nsa'm a very good explanation on their network configuration and it is an example of how to set up their server / client software ...
Comments
Post a Comment