1

We're using a COM object (called from a Classic ASP web application) to do a webservice call. Recently the webservice disabled TLS1.0. We've updated the COM object to .NET 4.6.2 and added the following code:

ServicePointManager.Expect100Continue = True
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11 Or SecurityProtocolType.Tls12
ServicePointManager.ServerCertificateValidationCallback = AddressOf AcceptAllCertifications ' This function returns true

Then a SOAP request is made using a custom certificate (issued by the webservice company) using a X509Certificate2 object. When running in a console application everything works fine. However, when the DLL is registered and called from Classic ASP the following exception is thrown:

System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()

That's all unfortunately. Things we tried:

  • Setting KeepAlive to True in the request
  • Changing the local group policy "Allow local activation security check exemptions" to Enabled

Any ideas?

Simon Mourier
  • 132,049
  • 21
  • 248
  • 298
Marthijn
  • 3,292
  • 2
  • 31
  • 48
  • It means you're not running in the same environment in the console mode vs the asp classic mode. The framework runtime in your asp classic mode is probably too old. – Simon Mourier Oct 23 '18 at 11:28
  • See this post. Your solution work for 4.5 and higher. Try this solution (for 4.0). https://stackoverflow.com/questions/33761919/tls-1-2-in-net-framework-4-0 – DanB Oct 23 '18 at 13:05
  • @DanielBlais I downgraded to 4.0, same problem. – Marthijn Oct 23 '18 at 13:17
  • @SimonMourier The original DLL was built for .NET 2.0, so I think you're right – Marthijn Oct 23 '18 at 13:17

0 Answers0