>_ IzzyLab

Hands-on task

This task is step 10 of the course “Investigating a server”

openssl: verify the trust chain

easy~3 min

There is a CA certificate /root/ca.crt and two server certificates — /root/web.crt and /root/api.crt. Only one of them was issued by this CA. Verify the chain of trust of both and write the results of both checks to /root/verify.txt: the line with OK for the valid one and the error message for the other.

What you'll practise:
  • openssl
  • pki
  • trust chain
  • certificate verification
  • output redirection

Topic breakdown

Trust in a TLS certificate rests on a chain of signatures: a server is considered trusted when its certificate is signed by the key of a certificate authority (CA) that we already trust. Verification builds the path from the leaf certificate up to the root and at each link checks the signature and validity periods; a tool from the openssl family can do this if you explicitly point it at the trusted root and the certificate being checked. Here it's important not to mix up the roles (which is the root and which is being checked) and to record the verification result to a file with plain redirection.

What's checked

  1. verification results for both certificates are written correctly

What it looks like