Security and certificates

Combine a .key and .crt into a .pem file

Some servers want the key and certificate in a single .pem file. Join them in one command.

Fill these in once
  1. Join them into one .pem
    Terminal
    cat server.key server.crt > server.pem

    Some software wants the certificate first. If so, swap the order.

Check it worked

  1. Check the certificate inside
    Terminal
    openssl x509 -in server.pem -noout -subject
  1. Join them into one .pem
    Terminal · Ubuntu / Debian
    cat server.key server.crt > server.pem

    Some software wants the certificate first. If so, swap the order.

Check it worked

  1. Check the certificate inside
    Terminal · Ubuntu / Debian
    openssl x509 -in server.pem -noout -subject
  1. Join them into one .pem
    PowerShell
    Get-Content server.key, server.crt | Set-Content server.pem

    Some software wants the certificate first. If so, swap the order.