In my ASP page I'm using the following code:
Dim webRequest As HttpWebRequest
webRequest = WebRequest.Create(url)
webRequest.Method = "POST"
webRequest.ContentType = "text/xml"
ct = False
webRequest.KeepAlive = False
webRequest.ContentLength = data.Length
Dim publicCert As X509Certificate = X509Certificate.CreateFrom
Dim str As Stream = webRequest.GetRequestStrea
On the last line the following error is generated:
[Win32Exception (0x80004005): The message received was unexpected or badly formatted]
[WebException: The underlying connection was closed: Could not establish secure channel for SSL/TLS.]
After turning on logging to the event queue (HKLM\SYSTEM\CurrentContro
ng = 7), the following message is logged:
The remote server has requested SSL client authentication, but no suitable client certificate could be found. An anonymous connection will be attempted. This SSL connection request may succeed or fail, depending on the server's policy settings.
The fullPath references (I checked it) the correct public *.DER certificate. I added the private key (*.pfx) to the Local Computer Personal Certificate Store using:
I'm using IIS 5 on windows 2000 and the .NET Framework 1.1 and I do NOT want to use a serviced component as described in:
The ASP page (IIS) seems to be running aspnet_wp.exe as local user ASPNET.
Also I downloaded Microsoft WSE 2.0 SP3 and used the X509 Certificate Tool to set full access permissions for user ASPNET on the private key file and changed the directory permissions on C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA and MachineKeys subdirectory to allow full access to the ASPNET user.
Still the errormessage remains the same...
Does anybody know how to use a client certificate from ASP.NET without using a serviced component?
Thanks in advance,