Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
2  
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. –  new2ruby Oct 10 '12 at 22:03

2 Answers 2

up vote 8 down vote accepted

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

share|improve this answer
    
I think that worked. Thank you! –  new2ruby Oct 10 '12 at 22:09

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
share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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