English 中文(简体)
AcquireCredentialsHandle returns SEC_E_NO_CREDENTIALS
原标题:
  • 时间:2009-11-13 05:15:13
  •  标签:
  • winapi
  • sspi

I created a self-signed certificate (created using OpenSSL) and installed it into the Certificate Store using the Certificates MMC snap-in (CertMgr.msc) on Windows Vista Ultimate.

I have managed to open the certificate store by using CertOpenSystemStore. And I can then find the certificate using CertFindCertificateInStore

However I am not sure what this error really means, as I have been unable to spot the answer in the MSDN documentation.

  • Is this a certificate problem?
  • Or an OS problem (in the sense it should be a Windows Server OS for this to work)?

I am using Win32 API in Delphi 2010, but C examples are fine.

最佳回答

The error description in MSDN? is rather vague:

No credentials are available in the security package.

Afaik this error means that the SSPI SChannel package did not find the private key for the certificate or the certificate is not valid for SSL/TLS. Make sure the certificate/private key are loaded in the PROV_RSA_SCHANNEL Crypto provider (CSP), not in the Enhanced CSP.

You should enable SChannel logging for (much) more detailed error info, see How to enable Schannel event logging (KB is for IIS, but the method described enabled Schannel logging globally on the machine):

HKEY_LOCAL_MACHINESystemCurrentControlSetControlSecurityProvidersSCHANNEL
EventLogging: DWORD = n

The value can be a combination of:

  • 0: Do not log (Windows NT 4 default)
  • 1: Log error messages (Windows 2000 and Windows XP default)
  • 2: Log warnings
  • 4: Log informational and success events

Been a while since I worked with SSL/TLS, but if I may give one advice: google for posts by "John Banes" and the error you have, you re likely going to find some clues.

问题回答

暂无回答




相关问题
How to read exact number of bytes from a stream (tcp) socket?

In winsock, both the sync recv and the async WSARecv complete as soon as there is data available in a stream socket, regardless of the size specified (which is only the upper limit). This means that ...

AcquireCredentialsHandle returns SEC_E_NO_CREDENTIALS

I created a self-signed certificate (created using OpenSSL) and installed it into the Certificate Store using the Certificates MMC snap-in (CertMgr.msc) on Windows Vista Ultimate. I have managed to ...

Calling Win32 EnumThreadWindows() in C#

I m trying to get a call to EnumThreadWindows working, but I always get a Wrong Parameter-Error, although my code is nearly the same as this example on pinvoke.net. I don t know why this doesn t work: ...

COM Basic links

folks can you provide me the tutorial link or .pdf for learning basic COM?. i do google it.. still i recommend answers of stackoverflow so please pass me.. Thanks

Handling multiple windows WIN32 API

HI I m trying to create an application in the Win32 environment containing more than one window. How do i do that? all the Win32 Tutorials on web i found only showed how to manage one window. How do i ...

Creating a thread in DllMain?

It seems that when a thread is created from within DllMain upon DLL_PROCESS_ATTACH it won t begin until all dll s have been loaded. Since I need to make sure the thread runs before I continue, I get a ...

热门标签