0

I am trying to create a webrequest to optimile soap services to gather some data. I have this all running perfectly on my laptop, but when i tried to push it to the server suddenly it started giving me "The request was aborted: Could not create SSL/TLS secure channel" errors.

I tried it on 3 different servers, all the same result. Tried it on my colleagues laptop and it worked as well. We both have visual studio installed so we might have some .net thingy installed the servers do not, but i cannot pinpoint what it is.

my code already contains these lines:

ServicePointManager.Expect100Continue = true;
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Ssl3;

and it finally errors on:

var response = (HttpWebResponse)request.GetResponse();

Again, it works perfectly on 2 laptops out of 2 tested (both visual studio installed) and doesn't work on 3 servers, out of 3 tested.

anyone got any pointers on what we can test?

  • What operating system is the publish machine. Older OS like IIS may not work with encryption mode in certificate. A common certificate is needed on both client and server. A compatible certificate may not be loaded on both client and server. TLS 1.3 certificates are not supported on IIS. – jdweng Jul 07 '23 at 14:23
  • 1
    Using a sniffer like wireshark or fiddler you can examine the TLS blocks. You will see version of TLS that is being used. TLS the server sends a certificate block with names of possible certificates. Then client looks up in stores the names of certificate to find a matching certificate. Best Practice is using Net 4.7.1 or later where the TLS is performed by OS (not in Net Library) – jdweng Jul 07 '23 at 14:26
  • The following may be of interest: [Transport Layer Security (TLS) best practices with the .NET Framework](https://learn.microsoft.com/en-us/dotnet/framework/network-programming/tls) – Tu deschizi eu inchid Jul 07 '23 at 15:30
  • Which version of Windows, and which version of .NET? Exact build numbers please. A Wireshark trace of the Server Hello and Client Hello packets would be very helpful also. – Charlieface Jul 07 '23 at 16:52

0 Answers0