chilipeppr / serial-port-json-server

Serial Port JSON Server is a websocket server for your serial devices. It compiles to a binary for Windows, Mac, Linux, Raspberry Pi, or BeagleBone Black that lets you communicate with your serial port from a web application. This enables web apps to be written that can communicate with your local serial device such as an Arduino, CNC controller, or any device that communicates over the serial port.
http://chilipeppr.com
GNU General Public License v2.0
322 stars 101 forks source link

How to generate missing tls cert for https? #66

Closed pastprimitive closed 4 years ago

pastprimitive commented 4 years ago

When I start SPJS v1.96 on OS X Catalina I get the following error message:

"Missing tls cert and/or key. Will not start HTTPS server."

I need it to run via https to connect to an app that runs inside of Onshape. But am unsure of what I need to do to generate the tls cert and/or key. If anyone could give me some guidance or point me in the right direction it would be much appreciated.

Thank you so much.

pastprimitive commented 4 years ago

Was able to figure out what needed to be done. So for anyone else wanting to run SPJS via https on OS X Catalina. You'll need to download at the very least the "sample-cert.pem" & "sample-key.pem" files from this repository. Then when you start serial-port-json-server use the following command from OS X terminal to run serial-port-json-server.

serial-port-json-server -scert "location of your copy of"/sample-cert.pem -skey "location of your copy of"/sample-key.pem

And you should be good to go.

Note: You do not have to build from scratch, you can use the v1.96 pre-compiled binary. You just need to add the above options when you run the server.