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

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

# convert .cert to cert.pem
cat > cert.pem

# add cert chain to the cert.pem
cat >> cert.pem

# clone pem
cp cert.pem staging.pem

openssl dhparam -dsaparam -out /etc/nginx/ssl/dhparam.pem 4096
tar -cxvf tar -jcvf *.pem

Upload to server and renew ssl certification

tar -jxvf
mv all the pem file to /home/mywebsitepath

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

# Restart nginx instance
docker restart nginx