cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

How to change ws in VendingMachineSimulator into wss?

CharisGuan
1-Newbie

How to change ws in VendingMachineSimulator into wss?

In server.xml,SSL = Ture,and I can access my thingworx webpage.Aanjan RaviFabio MannitiDonna Reynolds

6 REPLIES 6
sharmon
12-Amethyst
(To:CharisGuan)

Before you try anything else, change the uri from ws://127.0.0.1:8443/Thingworx/WS to wss://127.0.0.1:433/Thingworx/WS and try again. You could also try 8443 for the port (I'm using an example I have that's up-and-running; your ssl port may be configured differently.)

If that doesn't work, you probably have certificate trust problems. I run into this one every time I upgrade Java.

I see you're using a local instance. SSL is enabled with a certificate that's probably self-signed. Java isn't going to trust your self-signed certificate. When you try to make the wss (ssl) connection, it's going to refuse, because it won't trust the certificate on your local instance. You'll need to import the certificate into the list of trusted ones in your Java keystore.

Make an HTTPS connection to your local ThingWorx instance, and use the browser to get a copy of the certificate. Once you've done that, follow the steps in the following link to get Java to trust it -> Add a certificate to the Java CA store | Microsoft Azure. (It says Azure, but the instructions are broadly applicable). Once you've done that, your wss connections should go through.

Thanks for your advice.

My  question is :Where to change the uri? ,as you konw , I double-click the bat,it will run.In wsiavavmstart.bat: java -jar VendingMachineSimulator.jar

In TrainingConfig.json:

{

    "ServerLocation": "127.0.0.1",

    "Port": 8443,

    "AppKey": "1c6d618d-61a7-4b29-a565-9c8ac01d6208",

    "Security": false,

    "RemoteRepo": "/ThingworxRemoteRepository"

}

In  IE explorer, I can access the webpage.

and Yes, My certificate is "self-signed",I try to import it into the list of trusted ones in Java keystore,but it still can't work.

my friend, I add self-signed certificate to the list ,as bellows,but the endpoint still can't access .

Wei, is your platform setup for SSL? If not, please refer to this KCS article. What are the configuration options you set (on the .json file) for this simulator?

Thanks .

In TrainingConfig.json:

{

    "ServerLocation": "127.0.0.1",

    "Port": 8443,

    "AppKey": "1c6d618d-61a7-4b29-a565-9c8ac01d6208",

    "Security": false,

    "RemoteRepo": "/ThingworxRemoteRepository"

}

Any solution of this how to change as to wss. Same issue I am facing.

Please respond.

Top Tags