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 1 of 8 · on a machine · 4 min

The site will not open

What you will learn

  • Tell from a curl error which certificate check failed — expiry, name or issuer.
  • Read the fields of the certificate a server serves and of a certificate in a file.
  • Issue a new certificate with the existing key, signed by a certificate authority.

A complaint came in this morning: the internal site secure.lab.test will not open. It worked yesterday, and nobody changed the nginx configuration. Check that the service is alive, and request the page with curl the way a browser does — over HTTPS.

Exercise · look

Request the site's page

Check whether nginx is running, and request the home page https://secure.lab.test/.

First, predict

What will curl print?

Now start the exercise, run the command and compare your prediction with the output.

Sign in and start The machine is available after signing in
Check yourself 1 question

nginx is running, yet there is no page. Who broke off the connection?

  • The connection was made: curl received the certificate and checked its validity. Without a connection it says Couldn't connect to server.

  • A refusal from nginx would come as an HTTP response with a code like 403, and curl would print it. Here HTTP never started: curl itself prints SSL certificate problem.

The client checks the certificate — curl received it, saw it had expired and closed the connection.

Ubuntu 24.04
Loading…