J
JerryK
Hi,
I have an app that needs to access a java webservice to validate a piece of
data. This webservice is found on a server that requires a SSL certificate
to authorize use.
I created a webreference with the provided WSDL file. However, when I call
the function I get a 403: Forbidden error when called in an ASP.net page.
The code that calls the service is shown below and does not generate the
error when I called from a C# or VB winforms app.
PublicFunction MemValidate( num as string) as boolean
dim ValService as new webserv.ValService
System.Net.ServicePointManager.CertificatePolicy = new NetPolicy
ValService.ClientCertificates.Add(X509Certificate.CreatefromCertFile("c:\root.cer"))
ValService.ClientCertificates.Add(X509Certificate.CreatefromCertFile("c:\int.cer"))
ValService.ClientCertificates.Add(X509Certificate.CreatefromCertFile("c:\client.cer"))
return ValService.Validate( num ) ' exception occurs here
End function
Public Class NetPolicy
implements ICertificatePolicy
public shared DefaultValidation as boolean = false
public function CheckValidationResult (...) as boolean
return true
end function
End class
Without adding the client certificates I generated the 403:forbidden error
even from the Winforms clients. I am run with the impersination set to me
and my account has admininistrator privledges on the system.
Any thoughts?
Thanks,
Jerry
I have an app that needs to access a java webservice to validate a piece of
data. This webservice is found on a server that requires a SSL certificate
to authorize use.
I created a webreference with the provided WSDL file. However, when I call
the function I get a 403: Forbidden error when called in an ASP.net page.
The code that calls the service is shown below and does not generate the
error when I called from a C# or VB winforms app.
PublicFunction MemValidate( num as string) as boolean
dim ValService as new webserv.ValService
System.Net.ServicePointManager.CertificatePolicy = new NetPolicy
ValService.ClientCertificates.Add(X509Certificate.CreatefromCertFile("c:\root.cer"))
ValService.ClientCertificates.Add(X509Certificate.CreatefromCertFile("c:\int.cer"))
ValService.ClientCertificates.Add(X509Certificate.CreatefromCertFile("c:\client.cer"))
return ValService.Validate( num ) ' exception occurs here
End function
Public Class NetPolicy
implements ICertificatePolicy
public shared DefaultValidation as boolean = false
public function CheckValidationResult (...) as boolean
return true
end function
End class
Without adding the client certificates I generated the 403:forbidden error
even from the Winforms clients. I am run with the impersination set to me
and my account has admininistrator privledges on the system.
Any thoughts?
Thanks,
Jerry