Certificate Error in Console Application

Sagar Pattnayak 1 Reputation point
2021-05-29T06:57:50.813+00:00

Hi,
I have a console application which connects to docuemntum (OpenText D2) system using DFS Dlls to run queries and get data. The application runs fine in our olders VMs (OS Win Server 2012 R2).

However the same application does not run on a recently created VM (OS Windows Server 2019). I am getting an error

"System.ServiceModel.Security.SecurityNegotiationException: Could not establish secure channel for SSL/TLS with authority '<documentum end point url>'. ---> System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel."

I have downloaded the certificate by opening the documentum end point url on browser and installed it on Trusted Root Store. I have also tried completely disabling the certificate from code like below.

ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(OnValidateCertificate);
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12
| SecurityProtocolType.Ssl3;

Any idea what could be going wrong. Is it something at OS level that i need to check, because as I mentioned earlier the app is working in Server 2012 but not in Server 2019.

Please help!!

Br
Sagar

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,449 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ken Tucker 5,861 Reputation points
    2021-05-30T11:23:31.203+00:00

    SSL3 is no longer supported and should be disabled on Server 2019. You need to use tls 1.2 or 1.1

    Try changing code to

     ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
       | SecurityProtocolType.Tls11
       | SecurityProtocolType.Tls12;
    

    You of course need to make sure TLS 1.1 or 1.2 is enabled on <documentum end point url>

    https://us-cert.cisa.gov/ncas/alerts/TA14-290A


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.