What does HRESULT 0x80090336 (SEC_E_WRONG_CREDENTIAL_HANDLE) mean?

 
Previous Next
SEC_E_NO_IP_ADDRESSES SEC_E_CRYPTO_SYSTEM_INVALID

SEC_E_WRONG_CREDENTIAL_HANDLE

SEC_E_WRONG_CREDENTIAL_HANDLE means that the credential handle supplied to SSPI does not match the credentials associated with the security context. It is not a remote authentication rejection; it identifies an invalid local pairing of handles.

Common causes

  • Reusing a context after its credentials were released or replaced.
  • Mixing credential and context handles belonging to different connections or packages.
  • Concurrent code updating the active credential set while another thread continues an old handshake.

What to do

Bind each context to the credential handle that created it and retain both until the context is deleted. When credentials change, establish a fresh context instead of swapping the handle under an existing one.

Microsoft: AcquireCredentialsHandle (Schannel) · SSPI Status Codes


Looking for a different code? Search another status or error code.