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.

  • 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. Oct 10, 2012 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, 2012 at 22:03

3 Answers 3


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


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


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
  • I didn't downvote, but a little more explanation about what is going on here would have been better.
    – Zoredache
    Oct 10, 2012 at 22:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .