Could not create SSL/TLS secure channel error with API call and asp.net

awesome thanks. I have crazy day today with early gig tonight. Its bike fest here and its a huge weekend. So several gigs and early one today. So I’ll probably get to testing this on sunday or monday. Thanks again and have a great weekend. I will report back.

ok, no luck on that either. I updated the files. Uploaded to server. start and stopped the application pool, and stopped and started the website.

is there a way I can look at the source code? to try a couple things? Or is it compiled?

Here are couple things we could try? According to that link from above?

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

but scratch the SSL3 I know they don’t support that.

or adding

System.Net.ServicePointManager.SecurityProtocol = (System.Net.SecurityProtocolType)3072;

Maybe take another look at this link
https://stackoverflow.com/questions/10822509/the-request-was-aborted-could-not-create-ssl-tls-secure-channel

Could we try another version with this, this was from the docspring.com folks

// using System.Net;
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
// Use SecurityProtocolType.Ssl3 if needed for compatibility reasons

I will be at that job site tomorrow. So If you could send early in the day I will be getting to this about 9am CST

Ok wasn’t sure on format of this stuff. I don’t think I have the knowledge to actually recompile the files. Any chance you can just add this to it and recompile? I hate to be such a pain in the ass. I just desperately need to get this working. Holding my whole project up at this point.

// using System.Net;
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
// Use SecurityProtocolType.Ssl3 if needed for compatibility reasons

maybe throw ssl3 in there for testing? I know its insecure but at least we could troubleshoot issue.

Version with the Expect100Continue line added:

DMXzone.ServerConnect.API.zip (7.0 KB)

could we try all 4 just for testing?

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

The hosting company set me up a dedicated VM server to test on. So still not working over there. So maybe its trying to attach through Ssl3?

Here the version wil all 4 protocols, ssl3 is also added.

DMXzone.ServerConnect.API.zip (7.0 KB)

I’ll try this this morning. The hosting company has set me up another VM server so that I can test over there. They wanted to see the script work. I had another IIS server that i use for a different client (thats a physical server no VM), had never used it on that server before and script ran perfect first time no issues. So the VM server is a 2012 server, so they are changing the test VM server to 2016 to see if that helps any. I will try the updated serverconnect.api this morning and see if that helps.

ok @patrick, they changed the testing server to a 2016 server and that did the trick! Worked first time no problems. Just the default serverconnect.api worked like a charm. So I guess at this point gonna have to say that the api connector might not be 100% compatible with the 2012 version of windows server. So just a heads up on that.

I mean what was weird was I was able to connect to another public API for testing. Just not the one I needed. But looking like 2016 is gonna be the answer. So have to see if my VM can just be upgraded or if I will have to install new 2016 and then reset up all of the sites there, which is a pain because of folder rights and stuff.

With older windows versions the TLS1.2 is not enabled by default, you need to change some registry settings for that.

Update to enable TLS 1.1 and TLS 1.2 as default secure protocols in WinHTTP in Windows (microsoft.com)

This applies for Windows Server 2008 R2 SP1 and Windows Server 2012, later windows versions have it enabled.