4

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?

awj
  • 7,482
  • 10
  • 66
  • 120
Remy
  • 12,555
  • 14
  • 64
  • 104
  • seems like same issue as in https://social.msdn.microsoft.com/Forums/azure/en-US/ca6372be-3169-4fb5-870f-bfbea605faf6/azure-webapp-webjob-exception-could-not-create-ssltls-secure-channel?forum=windowsazurewebsitespreview, where Nazim Lala is looking at the issue. please join the MSDN forum thread for the latest. – Xiaomin Wu Dec 29 '15 at 01:17
  • Thanks, yes it seems to be. I posted my question there too, but no answer yet. – Remy Dec 29 '15 at 07:24

1 Answers1

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/

Ogglas
  • 62,132
  • 37
  • 328
  • 418