Using OpenSSL Tool
Once OpenSSL is installed, open terminal and execute the following commands
mkdir certs
openssl req -x509 -newkey rsa:4096 -keyout certs/key.pem -out certs/cert.pem -nodes -days 365
This will create a folder certs
and add two files key.pem
(the private key) and cert.pem
(the public key) to it.
Note: before the keys are generated, OpenSSL will prompt you to provide pertinent information. For the purposes of this demo, the information you provide need not to be accurate (e.g. just put something as organization name).
You must keep the certs
folder in the app-folder
. However, you should not upload it to a public repository like on GitHub (thus the folder is not included in the repository for this demo app).