Well im working agains a webservice that has a certificate that is not 100% correctly setup the certificate is setup for the domain *.domain1.com and the api is located at soap.shop.domain1.com/SOAP now i cant connect to this webservice as i then get a WebException "Could Not establish trush relationship for the SSL/TLS secure channel. --> The remote certificate is invalid according to the validation procedure.
Now my question is there any way to bypass this check i use a normal Web Reference (2.0) not a Service Reference..
Yes, you can use the following to have ASP.NET ignore the certificate warnings:
pick you flavor..
lambda expresions
or plain clode (better for testing)
You need to handle the event that validates the certificate and just set it to always return true. See the following post for details:
http://8r13n.wordpress.com/2007/07/24/bypassing-certificate-validation-in-net/
For those who can't determine where to start with this answer, it may not be obvious. The posters above are getting it right, but it wasn't apparent upfront on what to do with the given code.
Let's say you have a class somewhere that needs to call a web service with a certificate.
Here's my finished solution: