Merge or Concatenate SSL Certificates to Single File
I’ve received the root and intermediate certificates separately, then run the following command to merge or concat it into single file.
sibunglon@sanita$ tree
├── ChainCA1.crt
├── ChainCA2.crt
├── sibunglon.com.key
├── RootCA.crt
└── star_sibunglon_com.crt
for ssl_combine in {star_sibunglon_com.crt,ChainCA1.crt,ChainCA2.crt,RootCA.crt}; do
cat ${ssl_combine} >> /etc/ssl/sibunglon.com.crt
echo -e "\n" >> /etc/ssl/sibunglon.com.crt;
done
Then, i can use sibunglon.com.crt
as SSL certificate file and sibunglon.com.key
as SSL certificate key file.
sibunglon@sanita:~$ cat /etc/self-signed.conf
ssl_certificate /etc/ssl/sibunglon.com.crt;
ssl_certificate_key /etc/ssl/sibunglon.com.key;