【发布时间】:2022-02-03 10:48:00
【问题描述】:
我正在开发一个需要升级才能在 Windows-11 上使用 TLS 1.3 的 TLS 客户端。有没有人使用 SChannel API 成功实现 TLS 1.3?
根据 Microsoft 以下链接,win-11 和 server-2022 支持 TLS 1.3
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 操作系统构建 22000.434
注册表更改:如下所示链接: how to enable TLS 1.3 in windows 10
非常感谢任何建议或一小部分 C++ 代码示例, 以及任何可以帮助我了解客户问题所在的建议。
仅供参考:我没有使用 CURL LIB。
谢谢
问候:阿杰·贾斯瓦尔
【问题讨论】:
-
请尝试将问题集中在一个特定问题上。询问其他人是否使用过它以及询问示例代码是题外话。如果你展示你的代码,帮助会更容易
-
你控制连接的两端吗?完全有意义的是接收端不支持正确的版本,所以你得到的错误就是它所说的
标签: c++ tls1.3 windows-11 schannel