Skip to main content
1-Visitor
September 2, 2015
Solved

twApi_SetSelfSignedOk() equivalent in .NET SDK?

  • September 2, 2015
  • 1 reply
  • 4141 views

I'm trying to create a test program with .NET SDK but it doesn't seem to be working.

I've got a working version ready made with C SDK but we'd need to get the actual program working on .NET SDK while there're other components requiring it.

With C SDK I had problems without twApi_SetSelfSignedOK() function call so I thought if that'd be the case here also. Only similar method I found from .NET SDK is calling ClientConfigurator.ignoreSSLErrors(true) but the code ain't working with that.

Otherwise the codes are pretty similar, both a bit modified from SteamSensor examples (property changes etc). .NET program doesn't even get to the communication logs on ThingWorx as opened WebSocket, as didn't the program with C without the twApi_SelfSignedOK() call.

Only thing that seem to matter I get by debugging the code with Visual Studio was this line in the outputs (no errors):

A first chance exception of type 'System.Security.Authentication.AuthenticationException' occurred in System.dll

Not sure if this means anything related to connection problems but it's a guess.

While running the code, ConnectedThingClient.start() works without throwing any Exceptions but it's not connected. Tried seperately the .connect() method but that does no difference.

Best answer by jeff11

I believe the specific function you are looking for is AcceptSelfSignedCertificates(<Boolean>). The ThingWorx Edge/Connectivity Help Center has a very helpful document that will explain this function as well as the other configuration parameters that are available to the .NET SDK ClientConfigurator Class:

http://support.ptc.com/cs/help/thingworx_hc/thingworx_edge/index.jspx?id=dotnetsdk_topics-c_dotnet_sdk_reference_clientc…

1 reply

jeff115-Regular MemberAnswer
5-Regular Member
September 2, 2015

I believe the specific function you are looking for is AcceptSelfSignedCertificates(<Boolean>). The ThingWorx Edge/Connectivity Help Center has a very helpful document that will explain this function as well as the other configuration parameters that are available to the .NET SDK ClientConfigurator Class:

http://support.ptc.com/cs/help/thingworx_hc/thingworx_edge/index.jspx?id=dotnetsdk_topics-c_dotnet_sdk_reference_clientc…

miikkae1-VisitorAuthor
1-Visitor
September 2, 2015

Hi, and thanks for your reply!

I'm using Thingworx dotNet SDK 5.0.1.103 and it doesn't seem to have such function, at least in com.thingworx.communications.client.ClientConfigurator class.

There're also quite many other functions in that documentation that it doesn't seem to have.

Thank you for the link, I'll keep looking further into it.

5-Regular Member
September 2, 2015

Miikka, it looks like you are using an older version of the dotNet SDK. Our current released version is 5.5. Please do download the new one and retry.