>_ IzzyLab

Hands-on task

This task is step 4 of the course “TLS and certificates”

Verify the chain of trust

medium~7 min

/root contains a certificate authority certificate ca.crt and two server certificates — server.crt and backup.crt. Both claim to be issued by this CA (their Issuer field is CN=CA), but whether that's really true is unknown: an issuer name is easy to fake, a signature is not.

Check each certificate against ca.crt and write the result of checking both to /root/verify.txt: for the genuine one — the line with OK, for the fake one — the message saying the verification failed.

What you'll practise:
  • openssl
  • pki
  • chain of trust
  • verify

Topic breakdown

Verifying a certificate is about the chain of trust: the openssl verify utility builds a path from the certificate being verified up to a trusted root, checks the signature at each link, and also validates the expiry dates. The trusted root (CA) and the certificate being verified are supplied at different positions — you can't swap them, or the check will fail. On success it prints a line with the OK status and returns a zero exit code; on a mismatch — the reason and a non-zero code.

What's checked

  1. the check result is written
  2. the correct check result is written for each certificate

What it looks like