How to remove passphrase from a certificate already issued by a CA and active on the server?

May 29, 2014 2k views
Hello. Is there a way to remove the passphrase from a certificate considering it has already been issued and activated by a CA? I mean, what happens now is that I've purchased a certificate with a CA from Namecheap and activate it, they issued me a few certificate files which I combined and properly set it up on my nginx server, however, every time I have to restart nginx I'm asked for the passphrase What I don't' understand is that I've executed the command which removes the passphrase from the certificate before submitting its CSR to the CA... Is there a way I can safely remove the passphrase from my certificate considering it was already issued by the CA and is active on my server? Thanks in advance.
5 Answers
The passphrase is not on the certificate or CSR, so you never removed anything. It is on the key file.

openssl rsa -in /path/to/keyfile out -/path/to/keyfile.decrypted

will do what you want.
Hey gparent. Thanks for your help.

Unfortunately it didn't work for me. My serve key is stored in etc/nginx/ssl/, let's say it is called, so I've tried to remove the passphrase from it using the command you suggested such as:

openssl rsa -in /etc/nginx/ssl/ out -/etc/nginx/ssl/

Could you please tell me if is it right?

I've restart nginx after executing the command but I'm still being asked for the passphrase.
@Adriano: You then either need to point to the new /etc/nginx/ssl/ file in the Nginx configuration or move the password encrypted key out of the way and rename the decrypted file to /etc/nginx/ssl/
Yeah, I wrote the command this way so that you could have the output file separate from your input file.

Simply adjust the config appropriately to use the new, unencrypted key, or overwrite the encrypted key with the non-encrypted one.
Thank you Andrew SB and gparent!

The following command was the only one which worked out of the box for me:

sudo openssl rsa -in /path/to/ -out /path/to/

Thank you gparent for the explanation regarding where the passphrase is stored.

Have another answer? Share your knowledge.