我正在开发一个需要升级才能在 Windows-11 上使用 TLS 1.3 的 TLS 客户端。有没有人使用 SChannel API 成功实现了 TLS 1.3?
根据 Microsoft 下面的链接 TLS 1.3 在 win-11 和 server-2022 中受支持
https://docs.microsoft.com/en-us/windows/win32/secauthn/protocols-in-tls-ssl--schannel-ssp-
下面为 TLS1.3 添加了代码片段:
#define SECURITY_PROTOCOL_TLSV13 0x00
securityInfo->bySecurityProtocol = SECURITY_PROTOCOL_TLSV13;
sChannelCred->grbitEnabledProtocols =SP_PROT_TLS1_3_CLIENT;
status = pMyFunTab->**AcquireCredentialsHandleA**(NULL, UNISP_NAME_A, SECPKG_CRED_OUTBOUND, NULL, &sChannelCred, NULL, NULL, phCred, &ts);
返回状态 = SEC_E_ALGORITHM_MISMATCH (0x80090331)
**error details: Secure connection failed. An error occurred while trying to connect to the host, error code 0x80090331. The client and server cannot communicate, because they do not possess a common algorithm.**
api链接:
https://docs.microsoft.com/en-us/windows/win32/api/sspi/nf-sspi-acquirecredentialshandlea https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src/SecAuthN/acquirecredentialshandle --schannel.md
尝试了以下更改以修复相同的问题:
Windows 版本测试:windows 11 21h2 os build 22000.434
注册表更改:如下所示链接: 如何在 Windows 10 中启用 TLS 1.3
任何建议或 C++ 代码的小样本都非常感谢,以及任何可以帮助我了解客户问题的建议。
仅供参考:我没有使用 CURL LIB。
谢谢
问候:阿杰·贾斯瓦尔