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.
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.
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.
config.AllowSelfSignedCertificates = true;
config.DisableCertValidation = true;