title: FaultException `1 was unhandled : Invalid Certificate?
body: <p>Building a client app to consume WCF protected by a cert. Cert is installed and can access the WSDL via IE but the app throws an "FaultException `1 was unhanded: Invalid Certificate" once it hits CaseExists. Any ideas? If the cert was invalid, wouldn't it error out when hitting the WSDL in IE? </p>
  
  <pre><code>using System;
  using System.Configuration;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.ServiceModel;
  using System.ServiceModel.Security;
  using System.Security.Cryptography.X509Certificates;
  using System.ServiceModel.Description;
  using ConsoleApplication1.ServiceReference1;
  using System.Diagnostics;
  using System.ServiceModel.Channels;
  
  namespace ConsoleApplication1
  {
      class Program
      {
          static void Main(string[] args)
          {
              // binding
              BasicHttpBinding b = new BasicHttpBinding();
              b.Security.Mode = BasicHttpSecurityMode.Transport;
              b.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
  
              // endpoint
              EndpointAddress ea = new EndpointAddress(
                  "https://cut out endpoint.svc");
  
              // fire it up 
              EBondingClient client = new EBondingClient(b, ea);
  
              // toss in cert              
              client.ClientCredentials.Peer.PeerAuthentication.CertificateValidationMode =
                  System.ServiceModel.Security.X509CertificateValidationMode.None;
  
              client.ClientCredentials.ClientCertificate.SetCertificate(
                  StoreLocation.CurrentUser,
                  StoreName.My,
                  X509FindType.FindBySubjectName,
                  "cut.out.cert.name");
  
              // call
              Console.WriteLine(client.CaseExists("hello world"));
              client.Close();
              Console.ReadLine();
          }
      }
  }
  </code></pre>