Creating CSR for SSL Request on Ubuntu – Error Troubleshooting

opensslsslUbuntu

I am trying to create ssl certification on my website. To, create csr , I used the command:

openssl req –new –newkey rsa:2048 –nodes –keyout mydomain.key –out mydomain.csr

But, I get the error saying:

req: Use -help for summary.

I checked if openssl is installed or not, and it gives the version. So, it is installed.

I don't know what to do. I am fairly new to this. This is my first try to get the ssl. So, I am having hard time. Every help is appreciated.

Best Answer

Generate and sign the private key for my.domain.com using openssl.

Create a new encrypted private key.

openssl genrsa -aes128 -out /etc/pki/tls/private/httpdkey.pem

Enter httpd at the passphrase prompt (or just press empty). Generate a self-signed certificate using the key.

openssl req -new -x509 -key /etc/pki/tls/private/httpdkey.pem -out /etc/pki/tls/certs/httpdcert.pem -days 365

OR

  • Generate a certificate signing request to be sent to a certificate authority:
openssl req -new -sha256 -key {{filename.key}} -out {{filename.csr}}
  • Generate a self-signed certificate from a certificate signing request valid for some number of days:
openssl x509 -req -days {{days}} -in {{filename.csr}} -signkey {{filename.key}} -out {{filename.crt}}