When trying to execute a web method from ASP.NET page if fails producing
error:
[Win32Exception (0x80004005): The message received was unexpected or badly
formatted]
[WebException: The underlying connection was closed: Could not establish
secure channel for SSL/TLS.]
System.Net.HttpWebRequest.CheckFinalStatus()
System.Net.HttpWebRequest.EndGetRequestStream(IAsy ncResult asyncResult)
System.Net.HttpWebRequest.GetRequestStream()
.....
The same code works perfectly from console app. I have attached the X.509
certificate which is valid for this web service through the usage of
ClientCertificates.Add(). I noticed in MSDN docs that app needs to have
rights on the certificate file. Which account specificaly is meant by that?
I have added Everyone and ASPNET accounts full rights on that folder for
testing purposes. The same error is still here.
What else could be wrong here? Why does it work from console app but not
from ASP.NET web app?
Thank you,
Marko