C
CatpWilco
I have an ASP.Net application application that uses a client
certificate to communicate to a third party.
Now, in Win2K, to install the Class 1 Client Certificate, you have to
log in as the ASPNET user (or what ever user the aspnet_wp runs as),
and install the certificate for that user.
In Win2003 (IIS 6.0), I have followed the same process and it does not
work. I have not been able to find documentation on this. Any tips
out there?
Although my question does not refer to any code, here is a sample to
give a better picture of what the ASP.Net app is doing.
Dim oRequest As HttpWebRequest
Dim oResponse As HttpWebResponse
Dim oClientCert As
System.Security.Cryptography.X509Certificates.X509Certificate
Dim POSTBuffer() As Byte
Dim DataStream As System.IO.Stream
Dim sr As System.IO.StreamReader
Dim OutputString As String
POSTBuffer =
System.Text.Encoding.UTF8.GetBytes("DataToSend")
oClientCert = New
X509Certificate(X509Certificate.CreateFromCertFile(ApplicationConfig.CertificatePath))
oRequest = HttpWebRequest.Create("http://ThirdPartyURL")
oRequest.Credentials = CredentialCache.DefaultCredentials
oRequest.ClientCertificates.Add(oClientCert)
oRequest.Method = POST
oRequest.ContentType = "application/x-www-form-urlencoded"
Try
DataStream = oRequest.GetRequestStream()
DataStream.Write(POSTBuffer, 0, POSTBuffer.Length)
DataStream.Close()
'* * * * * * * * * * * * * * * * * * * * * * * * * *
'* Code fails here due to a 403.1 error
oResponse = CType(oRequest.GetResponse,
HttpWebResponse)
sr = New
System.IO.StreamReader(oResponse.GetResponseStream())
OutputString = sr.ReadToEnd
sr.Close()
catch ex Exception
'(more boring code) ...
Thanks,
R. Wilco
certificate to communicate to a third party.
Now, in Win2K, to install the Class 1 Client Certificate, you have to
log in as the ASPNET user (or what ever user the aspnet_wp runs as),
and install the certificate for that user.
In Win2003 (IIS 6.0), I have followed the same process and it does not
work. I have not been able to find documentation on this. Any tips
out there?
Although my question does not refer to any code, here is a sample to
give a better picture of what the ASP.Net app is doing.
Dim oRequest As HttpWebRequest
Dim oResponse As HttpWebResponse
Dim oClientCert As
System.Security.Cryptography.X509Certificates.X509Certificate
Dim POSTBuffer() As Byte
Dim DataStream As System.IO.Stream
Dim sr As System.IO.StreamReader
Dim OutputString As String
POSTBuffer =
System.Text.Encoding.UTF8.GetBytes("DataToSend")
oClientCert = New
X509Certificate(X509Certificate.CreateFromCertFile(ApplicationConfig.CertificatePath))
oRequest = HttpWebRequest.Create("http://ThirdPartyURL")
oRequest.Credentials = CredentialCache.DefaultCredentials
oRequest.ClientCertificates.Add(oClientCert)
oRequest.Method = POST
oRequest.ContentType = "application/x-www-form-urlencoded"
Try
DataStream = oRequest.GetRequestStream()
DataStream.Write(POSTBuffer, 0, POSTBuffer.Length)
DataStream.Close()
'* * * * * * * * * * * * * * * * * * * * * * * * * *
'* Code fails here due to a 403.1 error
oResponse = CType(oRequest.GetResponse,
HttpWebResponse)
sr = New
System.IO.StreamReader(oResponse.GetResponseStream())
OutputString = sr.ReadToEnd
sr.Close()
catch ex Exception
'(more boring code) ...
Thanks,
R. Wilco