3

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.

I am having hard time.

Dave M
  • 4,514
  • 22
  • 31
  • 30

3 Answers3

14

I was seeing the exact same behaviour trying to generate a CSR in Ubuntu based on the instructions i found on the digicert website. After searching around online forever I finally noticed that two of the hyphens in my command looked slightly different.

It looks like the instructions I copied actually contained some en dashes instead of hyphens.

When I manually typed out the command instead of copying/pasting the openssl command worked as expected

Copy/pasted Digicert command:

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

Screenshot of failed command

Manually typed Digicert command:

openssl req -new -newkey rsa:2048 -nodes -keyout ./server.key -out ./server.csr

Screenshot of successful command

JayWatt
  • 141
  • 1
  • 3
1

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}}
-1

I have spend few hours on this issue. In my case the problem was connected with dashes. I have copied and used this string from one site openssl req –new –newkey rsa:2048 –nodes –keyout dreamlist.key –out dreamlist.csr and it throwed req: Use -help for summary. issue. I have replaced all s(from command) with -(write by keyboard) and now it works just fine.

The problem is that in some sites they use special characters in commands which looks really similar to dashes, but that characters doesn't work in terminal.

Mher
  • 99
  • 1