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
toTrue
in the request - Changing the local group policy "Allow local activation security check exemptions" to Enabled
Any ideas?