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

南笙酒味 提交于 2019-12-04 03:47:35

问题


My Azure Web Application needs to connect to various servers (both with and without SSL). This works perfectly as long as I run the application in my local IIS Express or IIS 7.5 on Windows 10.

As soon as I deploy the application to Azure it stops working for certain servers that require SSL (thought not all). If I run it through ssllabs these normally get an A while the ones that work get a B or a C.

So I would assume that .NET on an Azure instance supports less ciphers than I locally support or something like that?

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. According to the below post there was a fix in October but it's December now.
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.

Any ideas? Or maybe to get started, how do I see what cipher my application is trying to use and what is available?


回答1:


Perhaps SSL3 or Tls1.0 are not supported? 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.

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



来源:https://stackoverflow.com/questions/34437473/could-not-create-ssl-tls-secure-channel-in-an-azure-web-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!