5 Replies Latest reply on Oct 28, 2016 12:29 PM by wguan RSS
    wguan 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

      • Re: How to change ws in VendingMachineSimulator into wss?
        sharmon Creator

        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.

          • Re: How to change ws in VendingMachineSimulator into wss?
            wguan Newbie

            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.

             

            • Re: How to change ws in VendingMachineSimulator into wss?
              wguan Newbie

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

            • Re: How to change ws in VendingMachineSimulator into wss?
              aanjan Heavyweight Champ

              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?