title: Could not establish trust relationship for the SSL/TLS secure channel with subject alternative name certificate
body: <p>I'm getting a System.Net.WebException</p>
  
  <blockquote>
    <p>The underlying connection was closed: Could not establish trust
    relationship for the SSL/TLS secure channel</p>
  </blockquote>
  
  <p>The inner exception is System.Security.Authentication.AuthenticationException </p>
  
  <blockquote>
    <p>The remote certificate is invalid according to the validation procedure </p>
  </blockquote>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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?</p>