When making a call to a web service running on a server using HTTPS my application throws a System.Net.WebException with the message "The underlying connection was closed: Could not establish trust relationship with remote server". I'm not sure how to get around this issue and successfully make the call.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
If you're using a self signed SSL cert, or an untrusted SSL cert, you can tell your application to ignore it (If you really want to ignore it). e.g.
You can place the callback anywhere that will be hit prior to executing your service call.
Tips given in answers should be used only for testing. For acceptance/production you should have WS certificate installed on machine making call to WS, and make certificate validation before calling WS - expiration, subject etc. Then you can add this certificate to WS request through SoapHttpClientProtocol.Proxy.ClientCertificates.
After some research, I found a blog entry by Jan Tielens which explains what is going on and a workaround for my problem: