AcquireCredentialsHandle 返回 SEC_E_SECPKG_NOT_FOUND
当尝试在 Windows 10 上检索凭据处理程序时,无论我为安全包提供什么功能,我都会收到此错误。 Kerberos 是 Windows 系统上的默认设置,因此我尝试进行以下调用:
SEC_WINNT_AUTH_IDENTITY *ident = NULL; // 这里填写了有效的凭据 静态 CredHandle 信用句柄;
AcquireCredentialsHandle( NULL, "Kerberos", SECPKG_CRED_OUTBOUND, NULL, (void*)ident, NULL, NULL, &credHandle, NULL );
我已在注册表中验证 Kerberos 是否与其他安全包一起存在。无论我尝试使用哪个包(Kerberos、SChannel、NTLM 等),我都会不断收到相同的错误。
When attempting to retrieve the credential handler on Windows 10, I get this error no matter what I provide the function for the security package. Kerberos is the default on Windows systems so I am attempting to make the following call:
SEC_WINNT_AUTH_IDENTITY *ident = NULL; // this is filled in with valid credentials
static CredHandle credHandle;
AcquireCredentialsHandle( NULL, "Kerberos", SECPKG_CRED_OUTBOUND, NULL, (void*)ident, NULL, NULL, &credHandle, NULL );
I've verified in my registry that Kerberos is present with other security packages. It does not matter which package I try to use (Kerberos, SChannel, NTLM, etc), I keep getting the same error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现了问题所在。仅使用“Negotiate”等字符串会出现 UTF-8 到 UTF-16 转换问题。为了解决这个问题,必须使用以下内容代替普通字符串:
(TCHAR*)TEXT(“谈判”)
I discovered what the issue was. There is a UTF-8 to UTF-16 conversion issue with just using a string such as "Negotiate". In order to resolve this the following must be used in place of a plain string:
(TCHAR*)TEXT("Negotiate")