6

I'm trying to generate a CSR with godaddy. I used the following commands to create the certificate:

openssl req -new -nodes -keyout server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

But when I use the key generated in my server.csr file, I get the following error from godaddy:

The CSR key length must be 2048 or 4096

How do I specify the key size of the CSR?

P.S. I'm intending to use this on a domain hosted on heroku.

2
  • 4
    I'm not familiar with OpenSSL, but it's not the CSR that needs to be 2048 bits, it's the Private Key that the CSR is generated for that needs to be 2048. – Mark Henderson Oct 10 '12 at 21:58
  • Ok, I think that's what I mean. It's telling me that the CSR key length is not the right length. – Kevin K Oct 10 '12 at 22:03
17

This should work for you:

openssl req -new -newkey rsa:2048 -keyout your.key -out your.csr

-newkey rsa:size - type and size of the private key

0
2

The way i prefer to do this is to edit the openssl.cfg and change the "default_bits" to "2048". In this way all keys you create will automatically start at the right size

0

You should specify the cypher type and key length with the -newkey parameter:

openssl req -new -nodes -newkey rsa:2048 -keyout server.key -out server.csr
1
  • I didn't downvote, but a little more explanation about what is going on here would have been better. – Zoredache Oct 10 '12 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.