{"action":"created","issue":{"url":"https://api.github.com/repos/ArxOne/FTP/issues/25","repository_url":"https://api.github.com/repos/ArxOne/FTP","labels_url":"https://api.github.com/repos/ArxOne/FTP/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/ArxOne/FTP/issues/25/comments","events_url":"https://api.github.com/repos/ArxOne/FTP/issues/25/events","html_url":"https://github.com/ArxOne/FTP/issues/25","id":136044036,"number":25,"title":"FTPS throwing exception - An existing connection was forcibly closed by the remote host","user":{"login":"kanikantik","id":17451326,"avatar_url":"https://avatars.githubusercontent.com/u/17451326?v=3","gravatar_id":"","url":"https://api.github.com/users/kanikantik","html_url":"https://github.com/kanikantik","followers_url":"https://api.github.com/users/kanikantik/followers","following_url":"https://api.github.com/users/kanikantik/following{/other_user}","gists_url":"https://api.github.com/users/kanikantik/gists{/gist_id}","starred_url":"https://api.github.com/users/kanikantik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kanikantik/subscriptions","organizations_url":"https://api.github.com/users/kanikantik/orgs","repos_url":"https://api.github.com/users/kanikantik/repos","events_url":"https://api.github.com/users/kanikantik/events{/privacy}","received_events_url":"https://api.github.com/users/kanikantik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"picrap","id":251429,"avatar_url":"https://avatars.githubusercontent.com/u/251429?v=3","gravatar_id":"","url":"https://api.github.com/users/picrap","html_url":"https://github.com/picrap","followers_url":"https://api.github.com/users/picrap/followers","following_url":"https://api.github.com/users/picrap/following{/other_user}","gists_url":"https://api.github.com/users/picrap/gists{/gist_id}","starred_url":"https://api.github.com/users/picrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/picrap/subscriptions","organizations_url":"https://api.github.com/users/picrap/orgs","repos_url":"https://api.github.com/users/picrap/repos","events_url":"https://api.github.com/users/picrap/events{/privacy}","received_events_url":"https://api.github.com/users/picrap/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2016-02-24T12:14:08Z","updated_at":"2016-02-24T13:17:09Z","closed_at":null,"body":"Hi,\r\n\r\nI am using Cerberus FTP server on Azure VM. When I user Filezilla client to connect to server over FTPS its working fine.\r\n\r\nWhen I use the below code it is throwing the error mentioned in the subject line\r\nusing (var ftpClient = new FtpClient(FtpProtocol.FtpS,\"xx.xx.xxx.xx\",990, new NetworkCredential(\"tenantuser1\",\"tenantuser1\")))\r\n            {\r\n                IEnumerable<FtpEntry> files = ftpClient.ListEntries(\"/\");\r\n            }\r\nHere is the stack trace\r\n\r\n   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)\r\n   at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)\r\n   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)\r\n   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)\r\n   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)\r\n   at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)\r\n   at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)\r\n   at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)\r\n   at ArxOne.Ftp.FtpSession.UpgradeToSsl(Stream stream)\r\n   at ArxOne.Ftp.FtpSession.CreateDataStream(Socket socket)\r\n   at ArxOne.Ftp.IO.FtpPassiveStream.SetSocket(Socket socket)\r\n   at ArxOne.Ftp.IO.FtpPassiveStream..ctor(Socket socket, FtpSession session)\r\n   at ArxOne.Ftp.FtpSession.OpenDirectPassiveDataStream(String host, Int32 port, TimeSpan connectTimeout, TimeSpan readWriteTimeout)\r\n   at ArxOne.Ftp.FtpSession.OpenPassiveDataStream(TimeSpan connectTimeout, TimeSpan readWriteTimeout)\r\n   at ArxOne.Ftp.FtpSession.OpenDataStream(Boolean passive, TimeSpan connectTimeout, TimeSpan readWriteTimeout, FtpTransferMode mode)\r\n   at ArxOne.Ftp.FtpClientUtility.OpenDataStream(FtpSession session, FtpTransferMode mode)\r\n   at ArxOne.Ftp.FtpClientUtility.ProcessList(FtpSession session, FtpPath path)\r\n   at ArxOne.Ftp.FtpClientUtility.<>c__DisplayClass1_0.<List>b__0(FtpSession handle)\r\n   at ArxOne.Ftp.FtpClient.Process[TResult](Func`2 action, FtpSession session)\r\n   at ArxOne.Ftp.FtpClientUtility.List(FtpClient ftpClient, FtpPath path)\r\n   at ArxOne.Ftp.FtpClientUtility.ListEntries(FtpClient ftpClient, FtpPath path)\r\n   at FTPTestAppConsole.Program.DownloadDirectory(FtpClient client, String source, String destination) in c:\\Users\\kkanikanti\\Documents\\Visual Studio 2013\\Projects\\FTPTestApp\\FTPTestAppConsole\\Program.cs:line 29\r\n   at FTPTestAppConsole.Program.Main(String[] args) in c:\\Users\\kkanikanti\\Documents\\Visual Studio 2013\\Projects\\FTPTestApp\\FTPTestAppConsole\\Program.cs:line 23\r\n   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)\r\n   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n   at System.Threading.ThreadHelper.ThreadStart()\r\n\r\nLet me know if I have to specify any certificate for FTPS.\r\n\r\nThanks,\r\nKrishna Priya\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ArxOne/FTP/issues/comments/188251487","html_url":"https://github.com/ArxOne/FTP/issues/25#issuecomment-188251487","issue_url":"https://api.github.com/repos/ArxOne/FTP/issues/25","id":188251487,"user":{"login":"picrap","id":251429,"avatar_url":"https://avatars.githubusercontent.com/u/251429?v=3","gravatar_id":"","url":"https://api.github.com/users/picrap","html_url":"https://github.com/picrap","followers_url":"https://api.github.com/users/picrap/followers","following_url":"https://api.github.com/users/picrap/following{/other_user}","gists_url":"https://api.github.com/users/picrap/gists{/gist_id}","starred_url":"https://api.github.com/users/picrap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/picrap/subscriptions","organizations_url":"https://api.github.com/users/picrap/orgs","repos_url":"https://api.github.com/users/picrap/repos","events_url":"https://api.github.com/users/picrap/events{/privacy}","received_events_url":"https://api.github.com/users/picrap/received_events","type":"User","site_admin":false},"created_at":"2016-02-24T13:17:09Z","updated_at":"2016-02-24T13:17:09Z","body":"I'll take a look at this shortly. Thanks for reporting the bug."}}