Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Received this question from a user. Thoughts? Thanks in advance.
Error -1 during socket initialization:
Hello,
This looks like the connection to the socket fails.
Is the Thingworx environment on localhost running with a self signed certificate?
If yes, please ask the user to change the Uri to wss://localhost:8443/Thingworx/WS and let me know if this resolves the problem.
At first glance it looks like the connection is refused.
Regards,
Pascal
I think you are on the right track. I am trying to connect to a trial version to do development and testing. When I ping our (purchased) live Thingworx core it connects and pushes property updates. When I installed the trial version I did not select SSL secure connection because I do not have a KeyStore.jks file or the KeyStore password.
Hope you are doing good. Could you please confirm if the issue has been resolved.
If yes, please mark the answer as accept as solution for the future reference. Thank you in advance.
Regards-Mohit Goel
No, I still cannot connect with the SDK. RestAPI connects OK.
Hello,
Can you provide your configuration and the url you're using to connect to the Platform? You can remove all internal information, important would be just the ports for the most part.
Thanks in advance.
Regards,
Pascal
wss://localhost:80/Thingworx/WS
config.AllowSelfSignedCertificates = true;
config.DisableCertValidation = true;
"wss://localhost:80/Thingworx/WS"
Visual Studio 2015, Tried .NET 3.5 -> 4.5.2
Hello,
I've done some further tests, is it correct that you're running the Thingworx environment with no certificate at all?
That's not recommended and would be rather difficult to work around, you can find one example how this can be done here, which is rather dated and untested from my side:
https://community.ptc.com/t5/ThingWorx-Developers/No-SSL-certification-in-C-SDK/td-p/530410
I would rather suggest to create a self signed certificate, which should give you less / no troubles when performing the connection from the SDK.
Let me know if you're still running into problem when using the self signed certificate.
Regards,
Pascal
Hi @billst
Hope you are doing good. Could you please confirm if the issue has been resolved.
If yes, please mark the answer as accept as solution for the future reference. Thank you in advance.
Regards-Mohit Goel