Aggregate errors when config ssl certificate using nginx

Post by Lưu Đại at 09-01-2024
This article is written to note errors that I've faced frequently when config ssl

1. Wrong Format file header / end

Some online guide usually has this command: 
cat xyz_xyz_cert.pem xyz_xyz_Chain_RootCA_Bundle.crt > xyz.support.crt
But when check the file result the end of pem file and the begin of rootca is in the same line.
image.png
The right format require begin cert and end cert has exactly 5 dash (-) at the end and the beginning. 

2. Private key and cert unmatch 

This error can be raised in 2 cases: 
Case 1: The previous support.crt file is wrong, maybe I import it wrong order like this
cat xyz_xyz_Chain_RootCA_Bundle.crt xyz_xyz_cert.pem > xyz.support.crt
Case 2: The private key file is wrong (even if it could be right before). 
This error usually happens when I ask the provider generates private key for me. 
Each year a new private key will be generated ( for security reason, the period will not always be 1 year, it could be 6 months to 1 year ). 
So if the provider generates that key for you, remember to ask them to send you the key.