I'm getting a System.Net.WebException
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel
The inner exception is System.Security.Authentication.AuthenticationException
The remote certificate is invalid according to the validation procedure
when using System.Net.WebClient.DownloadString(String address) against www.foo.com with a certificate for www.bar.com but with www.foo.com listed in the Subject Alternative Name field.
The certificate is issued by GoDaddy so Chrome and Internet Explorer consider the certificate valid when going to www.bar.com but also have no problems with the certificate when going to www.foo.com.
I think this should be a valid certificate for WebClient because the domain is listed in the Subject Alternative Name field, is this correct? Or does WebClient not use Subject Alternative Name field for SSL certificates issued to one site but used on another site?