Depends on what you are trying to do.
Are you trying to make a self-signed certificate?
OR
You are going to buy SSL certificate from godaddy?
In case you are going to get a certificate from godaddy:
- generate CSR file along with the private SSL key:
openssl req -newkey rsa:2048 -nodes -keyout domain.key -out domain.csr
- Follow the instructions from: https://ca.godaddy.com/help/nginx-on-centos-7-install-a-certificate-27192
In case of self-signed certificate:
generate CA ROOT key SSL
openssl genrsa -out rootca.key 2048
Generate CA ROOT PUBLIC SSL
openssl req -x509 -new -nodes -key rootca.key -sha256 -days 1024 -out rootca.pem
Generate Domain private SSL:
openssl genrsa -out mydomain.key 2048
Generate Domain CSR SSL
openssl req -new -key mydomain.key -out mydomain.csr
Generate public SSL key for the domain using the ROOT CA SSLs (that is what usually done by the SSL provider)
openssl x509 -req -in mydomain.csr -CA rootca.pem -CAkey rootca.key -CAcreateserial -out mydomain.pem -days 1024 -sha256
where,
mydomain.key - your private SSL, that you will use in your nginx config: ssl_certificate_key
mydomain.pem - you public SSL, that you will use in your nginx config:
ssl_certificate
rootca.pem - CA SSL, that you will need to install in your browser (e.g. Firefox)