title: Schannel: AcquireCredentialsHandle failed: SEC_E_UNKNOWN_CREDENTIALS, SSL connection error while accessing the certificates from console application
body: <p>This is tharun_atturu, I am trying to use the ACM certificates by importing them from the .pfx file. I get the desired result when the application is run with system privileges but when I try the console application with admin privileges I am getting the SSL connection error.</p>
  <pre><code>    X509Certificate2Collection collection = new X509Certificate2Collection();
                   collection.Import(certPath, CertFilePassword, X509KeyStorageFlags.MachineKeySet | 
                                                X509KeyStorageFlags.PersistKeySet);
                   X509Store RootStore = new X509Store(StoreName.Root, StoreLocation.LocalMachine);
                   X509Store CertificateAuthorityStore = new X509Store(StoreName.CertificateAuthority, 
                                                                                                          StoreLocation.LocalMachine);
                   X509Store ClientCertStore = new X509Store(&quot;ClientAuthIssuer&quot;, StoreLocation.LocalMachine);
                   RootStore.Open(OpenFlags.ReadWrite);
                   RootStore.Add(collection[0]);
                   CertificateAuthorityStore.Open(OpenFlags.ReadWrite);
                   CertificateAuthorityStore.Add(collection[1]);
                   ClientCertStore.Open(OpenFlags.ReadWrite);
                   ClientCertStore.Add(collection[2]);
                   RootStore.Close();
                   CertificateAuthorityStore.Close();
                   ClientCertStore.Close();
  </code></pre>
  <p>using libcurl to make an api call from cpp console application.</p>
  <p>ERROR:
  schannel: AcquireCredentialsHandle failed: SEC_E_UNKNOWN_CREDENTIALS (0x8009030D) - The credentials supplied to the package were not recognized</p>
  <p>Closing connection 0</p>
  <p>schannel: shutting down SSL/TLS connection with api*.com port 443
  curl_easy_perform() failed: SSL connect error</p>
  <p>Thank you.</p>