I am trying to host a react app I created and tested locally using the facebook boilerplate.
The client app interacts with an API I made using node.js, and with which I had no issue setting up a secure connection (with a node.js client sending my SSL certificate, for testing).
However, I am encountering difficulties when it comes to using react to send my SSL certificate instead of a self-signed one which causes me to encounter this error using chrome and trying to access to https://example.net:3000 :
Your connection is not private (NET:ERR_CERT_AUTHORITY_INVALID)
The documentation did not quite help me:
Note that the server will use a self-signed certificate, so your web browser will almost definitely display a warning upon accessing the page. https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#using-https-in-development
How can I use my own SSL certificate (which I already use on another app on my domain and works like a charm) instead of this self-signed one ? Did I miss something ?
I was able to get a local certificate working without modifying the webpack-dev-server
files using react-scripts
3.4.1
(technically added in 3.4.0
but I had some—probably unrelated—issues). I added these two environment variables to my .env.development
:
SSL_CRT_FILE=.cert/server.crt
SSL_KEY_FILE=.cert/server.key
Notes:
.cert
is a folder I created in the root of my project