Linux Labs

Web stack / Stage 4 of 9

Trust, name and expiry of a certificate

Not running Starting usually ~20 s
Leave the lesson

Step 7 of 8 · lab · 25 minmedium

The portal fails over HTTPS

Browsers no longer open the company portal over HTTPS. Give the portal a working certificate from the training CA and keep the existing key.

Situation

Since this morning users have been reporting that their browsers won't open the company portal at https://portal.lab.test, also known as https://www.portal.lab.test: "Your connection is not private". The portal is served by nginx on this machine.

Certificates for the company's sites are issued by an internal training certificate authority (CA). Its certificate and key are in /srv/lab-ca, and every company machine trusts the CA certificate, this one included. The portal's key and certificate are in /etc/ssl/portal, along with portal.cnf, the portal's certificate request settings for openssl req -config.

Don't change the portal's key: the company's mobile app knows the public part of this key and will not connect to the portal with a different one.

Task

  1. curl without -k opens https://portal.lab.test/ and https://www.portal.lab.test/ and gets the portal page.
  2. nginx presents a new certificate issued by the training CA.
  3. The new certificate is issued for the portal's existing key.
  4. The new certificate stays valid for at least 30 more days.

The machine has no internet access; everything you need is already installed.

Lab · on your own

No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.

Goals

0 of 4
  • curl without -k opens https://portal.lab.test/ and https://www.portal.lab.test/ and gets the portal page — not done yet
  • nginx presents a new certificate issued by the training CA — not done yet
  • The new certificate is issued for the portal's existing key — not done yet
  • The new certificate stays valid for at least 30 more days — not done yet
Ctrl+Enter
Starts the machine node1 · Ubuntu 24.04

The machine is starting

Hints

0 of 3

Lab goals

0 of 4
  • curl without -k opens https://portal.lab.test/ and https://www.portal.lab.test/ and gets the portal page — not done yet
  • nginx presents a new certificate issued by the training CA — not done yet
  • The new certificate is issued for the portal's existing key — not done yet
  • The new certificate stays valid for at least 30 more days — not done yet
node1 Ubuntu 24.04

Lab goals

0 of 4
  • curl without -k opens https://portal.lab.test/ and https://www.portal.lab.test/ and gets the portal page — not done yet
  • nginx presents a new certificate issued by the training CA — not done yet
  • The new certificate is issued for the portal's existing key — not done yet
  • The new certificate stays valid for at least 30 more days — not done yet
Loading…