question

Gerald avatar image
0 Likes"
Gerald asked Gerald commented

Can't Start Instance on FlexSim Webserver after setting up HTTPS

I am attempting to set up the webserver to use HTTPS, as seen in this post: https://answers.flexsim.com/questions/127966/flexsim-webserver-support-https.html. I have uncommented the mentioned lines of code, set the path to the certificate and the key files, and set the port to 443, as suggested in one of the comments. I can start the web server, but there is an error, as shown below, when it starts up. I have adjusted the firewall so that I can get to the web server using an HTTPS connection, but when I try to start an instance, it just hangs and tells me it can't start the instance.

Error message when starting FlexSim Webserver:

The above message is coming from the server.js file I edited to set up the HTTPS connection and is saying there is an error on line 356, but I did not edit this line at all. I can no longer connect to any instances even though I can see them start up.


Message when I try to start the instance from the webpage:

1697039663454.png


In the actual machine, I can see the Instance start, but It will just crash and close. Any help will be appreciated. I am using version 22.2.0

FlexSim 22.2.0
flexsim webserverconnecting to instance
1697039663454.png (66.3 KiB)
· 7
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Ben Wilson avatar image Ben Wilson ♦♦ commented ·
@Gerald, Have you ensured that all the paths are correct in your configuration file? You're pointing to the correct path for your installed version of FlexSim? All the other paths are correct?
0 Likes 0 ·
Gerald avatar image Gerald Ben Wilson ♦♦ commented ·

Hello Ben, and thanks for the response. By paths in the configuration file, do you mean the paths to the certificate and key? If so, then I have them pointed directly to the full path where they are located. However, they are not in the same directory as the server.js file but on the C drive elsewhere. Could this be the issue? The path to the installed version of FlexSim should be correct since I have not changed anything, and it will still work on the http connection.

0 Likes 0 ·
Gerald avatar image Gerald Gerald commented ·
I am getting a registration error when I try to connect through the https connection according to the log files.
0 Likes 0 ·
Show more comments
Gerald avatar image Gerald commented ·

I can start and run an instance on the webserver using the HTTP connection just fine. It is only when I try to go to the URL using HTTPS that the issue arises.

0 Likes 0 ·
Ben Wilson avatar image Ben Wilson ♦♦ Gerald commented ·

@Gerald ,

Sorry, I should have been more specific. I was referring to the file:

"flexsim webserver configuration.txt"

Which you can read about under the Configuration heading here:

https://docs.flexsim.com/Reference/DeveloperAdvancedUser/Webserver/Webserver.html#configuration

The fact that instances open fine when you're connected over HTTP suggests that configuration file is correct.

The fact that the control interface (used to launch instances with the blue, red, and green buttons) opens successfully over HTTPS suggests that your SSL configuration is correct and working properly.

Let's see if we can get any other suggestions from other community members. @Jacob Gillespie might have insights into the errors in your screenshot regarding server.js line 356 or others.

0 Likes 0 ·

1 Answer

Jacob Gillespie avatar image
0 Likes"
Jacob Gillespie answered Gerald commented
@Gerald Do you have two instances of the FlexSim Webserver running at the same time? I believe you should only have one instance of the Webserver running at any time even if they are bound to different ports.
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Gerald avatar image Gerald commented ·

I have figured out the problem is due to miscommunication with my team. There was an instance running of the webserver that was never restarted after the edits to set up the secure connection. Once that was terminated, the error when starting the Webserver and the registration issues went away. Thanks for the help, and sorry for the confusion.

0 Likes 0 ·