AcquireCredentialsHandle returns SEC_E_UNKNOWN_CREDENTIALS

From: sunit (sunit_at_newsgroup.nospam)
Date: 10/28/05


Date: Fri, 28 Oct 2005 14:44:41 +0530

I used AcquireCredentailsHandle to get the credentials of my SSL Socket for Server but it returns an error SEC_E_UNKNOWN_CREDENTIALS. When I checked in the Event Viewer, it displayed

A fatal occurred when attempting to access the SSL Server credentials private keys.The error code returned by the Crytographic module is 0x80090009

I have obtained my private keys using openssl. Then converted into the format needed by CrytoAPI(little
endian order) . I have created my key container as Machine Key Container (CRYPT_MACHINE_KEYSET) .I have used

Provider Type: PROV_RSA_FULL
Provider Name: MS_DEF_PROV

 my certicate is in MY (system Store)

/*code for AcquireCredentialsHandle*/

ZeroMemory(&m_SchannelCred, sizeof(m_SchannelCred));

  //Credentials are required by the Schannel authentication
  m_SchannelCred.dwVersion = SCHANNEL_CRED_VERSION;

  m_SchannelCred.cCreds = 1; //only one certificate store
  m_SchannelCred.paCred = &m_pCertContext; //pointer to the pointer of CERT_CONTEXT structure this how the certificate enters the credential which is used for security context in schannel authentication
 
  m_SchannelCred.hRootStore = m_hMyCertStore;//handle to certificate store
  m_SchannelCred.dwMinimumCipherStrength = 80;//strength of cipher
  
  m_SchannelCred.grbitEnabledProtocols =m_dwProtocol; //use any protocol
  m_SchannelCred.dwFlags |= SCH_CRED_NO_SYSTEM_MAPPER ;
 
 
  //using the Schannel SSP
  //function, which returns a handle to the requested credentials
  Status = m_SecurityFunc.AcquireCredentialsHandle( NULL, // Name of principal
                                                                               UNISP_NAME,//schannel package requested
                                                                               SECPKG_CRED_INBOUND,
                                                                               NULL,
                                                                               &m_SchannelCred,//structure contains the data required for SChannel
                                                                               NULL,
                                                                               NULL,
                                                                               phCreds,//pointer to CreHandle which receives the handle to credentials
                                                                               &tsExpiry);

  if(Status != SEC_E_OK && Status==SEC_E_UNKNOWN_CREDENTIALS)
  {
      
  ::OutputDebugString(_T("error:the handle to channel credential not available"));

  }

I am not understanding where is the problem.Pls Help me.
Thanx for any advice



Relevant Pages

  • Re: RWW
    ... "normal" Windows Server 2003 way... ... that this worked before trying RWW in this environment. ... enable Remote Desktop first and to add to the local Remote Desktop Users ... as well as entering credentials on the FBA logon page. ...
    (microsoft.public.windows.server.sbs)
  • Re: Sharing/Forwarding website credentials programatically
    ... What you are wanting is not really delegation of credentials from the portal ... can directly contact that server). ... authentication over SSL against a standard Active Directory account. ... essentially in the request-headers or URI itself. ...
    (microsoft.public.inetserver.iis.security)
  • Re: How to close LAN session and login as another credentials
    ... and is connected to a share on the server. ... these credentials, since it will automatically try to use the credentials of ... The problem is that from 1 login session on a PC, ... When I try to access administrator share ...
    (microsoft.public.windowsxp.network_web)
  • Re: AS 2005 HTTP access with Basic Authentication
    ... > than at the server as I was assuming. ... >> would work without demanding the basic authentication credentials again. ... >> AS 2000's PTS used WinInet to connect to the server over HTTP. ... >> - When PTS 8.0 ran within Internet Explorer, it's WinInet connections ...
    (microsoft.public.sqlserver.olap)
  • Re: Cached Logon
    ... "Roland Hall" wrote in message ... :>: supplies their credentials, and the browser sends them to the server. ...
    (microsoft.public.sqlserver.connect)