- Open SSL
Read here to install Open SSL.
- Step 1: Creating the directory where all our certificate configurations and generated key will be stored.
$ sudo mkdir cert
$ cd cert
- Step 2: Creating the certificate configuration file.
$ sudo touch cert.cnf
- Step 3: Editing the configuration file using gedit (following) or you can continue to use any text editor of your choice.
$ sudo gedit cert.cnf
Paste in the following configuration data:
[req]
default_bits = 2048
prompt = no
default_md = sha256
x509_extensions = v3_req
distinguished_name = dn
[dn]
C = GB
ST = Location
L = Location
O = My Organisation
OU = My Organisational Unit
emailAddress = email@domain.com
CN = localhost
[v3_req]
subjectAltName = @alt_names
[alt_names]
DNS.1 = localhost
- Step 4: Use Open SSL to generate the certificate.
sudo openssl req -new -x509 -newkey rsa:2048 -sha256 -nodes -keyout localhost.key -days 3560 -out localhost.crt -config cert.cnf
- Step 5: Copy the directory
cert
to SecureTea GUI directory, i.e.~/secure-tea-path/SecureTea-Project/gui
$ sudo cp -r ~/cert ~/secure-tea-path/SecureTea-Project/gui
- Step 6: Edit the
start
underscripts
inpackage.json
. Paste the following instead:
"start": "ng serve --ssl --ssl-key ./cert/localhost.key --ssl-cert ./cert/localhost.crt"
- Step 7: Trusting the new certificate, navigate to
cert
directory we created.
$ sudo cp localhost.crt /usr/share/ca-certificates/localhost.crt
$ sudo update-ca-certificates
- Step 8: Start the web server.
$ npm install
$ npm run start
That's it! This will enable local host web serving over HTTPS.