Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
[ FlexSim 22.2.1 ]
Hi,guys,
Does FlexSim Webserver support HTTPS transfer? And how to import the certificate?
Thanks
Solved! Go to Solution.
[ FlexSim 22.2.1 ]
Hi,guys,
Does FlexSim Webserver support HTTPS transfer? And how to import the certificate?
Thanks
Solved! Go to Solution.
You could use a reverse proxy to allow SSL with a valid cert that goes between the flexsim web service running without SSL and the public address that you access it from.
Alternatively, you can modify line 371 of C:\Program Files (x86)\FlexSim Web Server\webserver\server.js to use https instead of http. There's a commented-out example in the lines above it:
When you issue the certificate you would configure it to point to some URL of your choosing, like flexsim.mycompany.com.
In Phil's example code, shown in the image attached to his answer, you would comment out line 371 ("var flexsimServer..."), and un-comment lines 363-369.
In the un-commented chunk you need to reference the path to your certificate and key files. Modify the paths ("ssl/key.pem", "ssl/cert.pem") to point to paths on your webserver's file system where you have stored your certificate and key files. The location needs to be accessible by node.js. To use those default locations ("ssl/key.pem, "ssl/cert.pem"), you would create an ssl directory in the C:\Program Files(x86)\FlexSim Web Server\webserver directory. Then place your cert.pem and key.pem files in the ssl directory you just created.
Also, you will need to change the port in the 'flexsim webserver configuration.txt' file from 80 to 443.
In regards to using "a reverse proxy to allow SSL with a valid cert", please reference Paul Toone's recent articles on setting up behind a proxy: