gpt4 book ai didi

c# - Azure Web 应用程序中的 "Could not create SSL/TLS secure channel"

转载 作者:行者123 更新时间:2023-11-30 12:57:22 25 4
gpt4 key购买 nike

我的 Azure Web 应用程序需要连接到各种服务器(带或不带 SSL)。只要我在 Windows 10 上的本地 IIS Express 或 IIS 7.5 中运行该应用程序,此功能就可以完美运行。

一旦我将应用程序部署到 Azure,它就会停止为某些需要 SSL 的服务器(但不是全部)工作。如果我通过 ssllabs 运行它这些通常会得到 A,而有效的会得到 B 或 C。

所以我会假设 Azure 实例上的 .NET 支持的密码少于我本地支持的密码或类似的密码?

我已经尝试过了

ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12
| SecurityProtocolType.Ssl3;

还尝试了没有任何 TLS 标志的情况,因为这是大多数人的建议,但没有帮助。根据下面的帖子,十月有修复,但现在是十二月。
https://social.msdn.microsoft.com/Forums/en-US/ca6372be-3169-4fb5-870f-bfbea605faf6/azure-webapp-webjob-exception-could-not-create-ssltls-secure-channel?forum=windowsazurewebsitespreview

它也与 Cloud Flare 无关。

有什么想法吗?或者也许首先,我如何查看我的应用程序正在尝试使用的密码以及可用的密码?

最佳答案

也许不支持 SSL3 或 Tls1.0?我遇到了类似的问题,切换到此后一切正常:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12

您可以使用ssllabs来测试您尝试连接的服务器使用哪些协议(protocol)。

https://www.ssllabs.com/ssltest/

关于c# - Azure Web 应用程序中的 "Could not create SSL/TLS secure channel",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34437473/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com