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

If you look a the post above there is an SSL report of the maps.dockrealty.com and it shows that 1.2 is supported.

https://www.ssllabs.com/ssltest/analyze.html?d=maps.dockrealty.com

Just to make sure you have the latest version, here the latest dll.

DMXzone.ServerConnect.API.zip (6.9 KB)

I’ve checked in version control to see when TLS 1.2 support was added in the API connector, seems we added it in 2019, so that should be available.

Following stack overflow shows the same solution as we have implemented it. Seems it probably requires .net 4.5+ and doesn’t work on older .net versions. c# - Is that possible to send HttpWebRequest using TLS1.2 on .NET 4.0 framework - Stack Overflow

@patrick that didn’t seem to help?

I did notice that there was a DMXzone.ServerConnect.API.config.dll? The date on that is older would that have anything to do with anything?

Screen Shot 2022-08-03 at 9.36.54 AM

This is whats in that file? does it need to point to a newer version?

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

You can delete that file, should not be needed. You only need the dll and optionally the pdb file for debugging.

I am getting some new errors though…

Thats since I updated the DMXzone.ServerConnect.Api files

I in process of changing up the web.config file to see if I can see what exact error is.

And this is what I get after I add the to the web.config

And I know it has to be something with the server setup? If I pull the schema from wappler it works. And if I test the API with Postman, that also works. I’m just lost on what else to try?

Do you also have custom files in the Bin folder or only the ones from Wappler? I would advice to just remove all the files in the Bin folder and then reupload them all. After that you will need to restart the application pool.

Perhaps you could also do the same within Wappler, delete the content if the Bin folder. When you open a server connect action and save that again it should copy the latest versions of the dll files to the Bin folder.

The error with the validator was something that I’ve seen before and believe that it was fixed, but can’t currently find the topic about it.

Shouldn’t be any custom files in the /bin folder. But will try what you suggest by deleting everything and re-adding back. and then restarting the app pool.

Nope same thing. deleted /bin on local and server. Regenerated and recreated files and uploaded and restarted the application pool.

Is the error only with a specific action file or does it occur on all? What is in the action file?

Found a bug report with almost exactly the same error message, perhaps it is the same, please try the update that was posted there.

ASP.net: Error with API action in Server connect - Wappler General / Bugs - Wappler Community

Where is this code actually found?

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

That’s from the source code of the API module. I can send you the source code if you want to look at it and perhaps find a solution.

I’ve also updated the main Server Connect code to fix some of the cast errors that you also seem to get, perhaps that update also helps, we several asp.net updates coming.

DMXzone.ServerConnect.zip (56.6 KB)

ok, I’ll try that. I have access to another server that has asp.net on it and I used the exact same testing page/api and it worked perfect first time. So just not sure what else to try. The hosting company is a pain in the ass to try and get any help there.

Will there be an update today, or will it probably not be until next week?

I am still having problems getting this to work. You mentioned sending me the source code for that module. So I guess its compiled and I can’t just look at what its actually set to on my server?

I guess I am thinking of trying to remove everything from the /bin file again and then recreating to see if that might fix issue?

Or could you send me a version that is only set TLS1.2?

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12

I’m thinking the answer is in here somewhere?

https://stackoverflow.com/questions/10822509/the-request-was-aborted-could-not-create-ssl-tls-secure-channel

Here a version where only Tls12 is being set: DMXzone.ServerConnect.API.zip (7.0 KB)