Hi all, I have an aspx page that needs to call a remote website that is
protected by client cert authentication. I have installed the client cert
and set permissions for IIS_WPG as per
http://support.microsoft.com/default...b;en-us;817854. I then
exported the cert to a DER encoded file.
Now here is my code:-
Dim h as httpwebrequest
h = Ctype(WebReques t.Create(strurl ), httpwebrequest)
Dim mycert as X509Certificate =
X509Certificate .CreateFromCert File("c:\inetpu b\wwwroot\mycer t.cer")
h.clientcertifi cates.add(mycer t)
h.contenttype = "text/xml"
h.method = "POST"
h.contentlength = len(strbody)
Dim s as stream = h.getrequeststr eam()
Dim sw as new streamwriter(s)
sw.write(strbod y)
sw.close()
Dim hr as httpwebresponse = Ctype(h.getresp onse(), httpwebresponse )
Dim s2 as stream = hr.getresponses tream()
Dim sr as new streamreader(s2 )
returnstr = sr.readtoend()
sr.close()
Now here is the error I am getting back:-
The underlying connection was closed: Could not establish secure channel for
SSL/TLS.
Any Ideas? Please help. The same code works for a page that is not protected
by Client Certs.
thanks!