Hi,
1. Logon is done as domain user which is member of local administrator
group.
2. The certificate was found using the following code:
PCCERT_CONTEXT WINAPI CServerCredentials::CertFindForServerUsage(HCERTSTORE
hCertStore, PCCERT_CONTEXT pStart)
{
CTL_USAGE cu;
PCCERT_CONTEXT pCert;
LPSTR szArr[1];
szArr[0] = szOID_PKIX_KP_SERVER_AUTH;
cu.cUsageIdentifier = 1;
cu.rgpszUsageIdentifier = szArr;
return pCert = CertFindCertificateInStore(hCertStore, X509_ASN_ENCODING
,0,
CERT_FIND_CTL_USAGE, &cu, pStart);
}
3. Credential handle is obtained using
for ( m_pCertContext=NULL, Status=-1;FAILED(Status);)
{
m_pCertContext = CertFindForServerUsage(m_hMyCertStore, m_pCertContext );
if ( m_pCertContext == NULL )
{
Status = SEC_E_NO_CREDENTIALS;
break;
}
ZeroMemory(&m_SchannelCred, sizeof(m_SchannelCred));
m_SchannelCred.dwVersion = SCHANNEL_CRED_VERSION ;
m_SchannelCred.dwMinimumCipherStrength = 80 ;
m_SchannelCred.cCreds = 1 ;
m_SchannelCred.paCred = &m_pCertContext ;
m_SchannelCred.hRootStore = m_hMyCertStore ;
m_SchannelCred.grbitEnabledProtocols = 0 ; // let Schannel select a
protocol
m_SchannelCred.dwFlags = SCH_CRED_NO_DEFAULT_CREDS |
SCH_CRED_NO_SYSTEM_MAPPER |
SCH_CRED_REVOCATION_CHECK_CHAIN ;
Status = pSecurityFunc -> AcquireCredentialsHandle ( NULL,
UNISP_NAME,
SECPKG_CRED_INBOUND,
NULL,
& m_SchannelCred,
NULL,
NULL,
& m_hCreds,
& m_tsExpiry
) ;
}
At that point return code is SEC_E_UNKNOWN_CREDENTIALS. The problem occurs
not on each computer.
Regards,
Victor.
Post by Yu Chen [MS]Usually this error code is returned when you are passing in an unknown or
bad credential in pAuthData. What account is your program running as (i.e.
domain account or local account)? And what do you pass in pAuthData (what's
the domain and account)? If your program is running as local account but you
pass in a domain account in pAuthData you'll see this error.
--
Yu Chen [MS]
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Victor I. ZaslavskyHi folks,
AcquireCredentialsHandle fails on one of my servers with
SEC_E_UNKNOWN_CREDENTIALS error code. Unfortunatelly, I have found not tip
to understand why it happens.
Any help will be very appreciated.
Victor.