简体   繁体   English

Azure Web应用程序中的“无法创建SSL / TLS安全通道”

[英]“Could not create SSL/TLS secure channel” in an Azure Web Application

My Azure Web Application needs to connect to various servers (both with and without SSL). 我的Azure Web应用程序需要连接到各种服务器(使用和不使用SSL)。 This works perfectly as long as I run the application in my local IIS Express or IIS 7.5 on Windows 10. 只要我在Windows 10上的本地IIS Express或IIS 7.5中运行应用程序,这就完美无缺。

As soon as I deploy the application to Azure it stops working for certain servers that require SSL (thought not all). 一旦我将应用程序部署到Azure,它就会停止为需要SSL的某些服务器工作(不是全部考虑)。 If I run it through ssllabs these normally get an A while the ones that work get a B or a C. 如果我通过ssllabs运行它们通常会得到A而有效的则得到B或C.

So I would assume that .NET on an Azure instance supports less ciphers than I locally support or something like that? 所以我认为Azure实例上的.NET支持的密码少于本地支持的密码或类似的东西?

I've tried out this 我试过这个

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

Also tried it without any of the TLS flags, since this is what most people suggested, but it didn't help. 也试过没有任何TLS标志,因为这是大多数人的建议,但它没有帮助。 According to the below post there was a fix in October but it's December now. 根据下面的帖子,10月有一个修复,但现在是12月。
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 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

It also has nothing to do with Cloud Flare. 它也与Cloud Flare无关。

Any ideas? 有任何想法吗? Or maybe to get started, how do I see what cipher my application is trying to use and what is available? 或者也许要开始,我如何看到我的应用程序尝试使用的密码和可用的密码?

Perhaps SSL3 or Tls1.0 are not supported? 也许不支持SSL3或Tls1.0? I had a similar issue and after switching to this everything worked: 我有一个类似的问题,切换到这一切后,一切工作:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12

You can use ssllabs to test which protocols the server you are trying to connect to uses. 您可以使用ssllabs来测试您尝试连接的服务器使用哪些协议。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM