IIS 7.5 Secure Communication Error - The underlying connection was closed: Could not establish secure channel for SSL/TLS

StackOverflow https://stackoverflow.com/questions/23136790

  •  05-07-2023
  •  | 
  •  

Question

We are experiencing the following error when trying to use an external web service from our application deploy under IIS 7.5.

Error - The underlying connection was closed: Could not establish secure channel for SSL/TLS.

This works from other servers, but on this particular one it fails. This started happening when the server we are trying to connect with disallowed SSL connections and is only accepting TLS. As described in this link http://support.microsoft.com/kb/915599 we changed the registry, but are still seeing the error. Please see the attached image of the registry to make sure this was done properly. It seems like IIS is still trying to use the SSL protocol. I'm a bit confused where in the communication process IIS selects the protocol, SSL vs TLS. Maybe there's something that needs to be done to ensure TLS is selected? Other ideas?

IIS Resgistry

Was it helpful?

Solution

This was fixed at the code level by adding the following line -

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top