How to Convert Cert to Ssl

How to convert godaddy certification files from .cert to .pem

Recently days, I met an issue to renew ssl certification file for a website. The former developer setup certification file to .pem. It take a long time to make it work. Here we go.

Convert .crt to .pem

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16

# convert .key file to key.pem
openssl rsa -in mywebsite.com.key -text > key.pem

# convert .cert to cert.pem
cat mywebsite.com.crt > cert.pem

# add cert chain to the cert.pem
cat mywebsite.com.ca-bundle >> cert.pem

# clone pem
cp cert.pem staging.pem

#
openssl dhparam -dsaparam -out /etc/nginx/ssl/dhparam.pem 4096
tar -cxvf tar -jcvf mywebsite.com-v3.tar.bz2 *.pem

Upload mywebsite.com-v3.tar.bz2 to server and renew ssl certification

1
2
3
4
5
6
7
8
9

tar -jxvf mywebsite.com-v3.tar.bz2
mv all the pem file to /home/mywebsitepath

# Testing nginx configuration
docker exec -it nginx nginx -t

# Restart nginx instance
docker restart nginx
Licensed under CC BY-NC-SA 4.0
Last updated on Nov 08, 2024 12:49 UTC
Built with Hugo
Theme Stack designed by Jimmy