Re: An existing connection was forcibly closed by (General questions)
That issue occurs if we give
<identity impersonate= true /> in web.config file.
some suggestion to solve this issue. Please check the following link
http://support.microsoft.com/kb/948154
As per suggestion in the above link , I have given permission to the account for private key and modified the code like below.
Dim store As New X509Store( TrustedPeople , StoreLocation.CurrentUser)
store.Open(OpenFlags.[ReadOnly] Or OpenFlags.OpenExistingOnly)
Dim newCert As System.Security.Cryptography.X509Certificates.X509Certificate2 = store.Certificates.Find(X509FindType.FindBySubjectName, ftp.caldev2.com , False)(0)
ftps1.Certificate = newCert
But now I am getting the following error:
Failed to import private key.
If I give
ftps1.PrivateKey = newCert.PrivateKey
Error :
Keyset does not exist