Question

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

  • Posted May 29, 2014

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.

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Thank you Andrew SB and gparent! <br> <br>The following command was the only one which worked out of the box for me: <br> <br>---- <br>sudo openssl rsa -in /path/to/example.com.key -out /path/to/example.com.key <br>---- <br> <br>Thank you gparent for the explanation regarding where the passphrase is stored. <br> <br>

Yeah, I wrote the command this way so that you could have the output file separate from your input file. <br> <br>Simply adjust the config appropriately to use the new, unencrypted key, or overwrite the encrypted key with the non-encrypted one.

@Adriano: You then either need to point to the new <code>/etc/nginx/ssl/example.com.key.decrypted</code> file in the Nginx configuration or move the password encrypted key out of the way and rename the decrypted file to <code>/etc/nginx/ssl/example.com.key</code>

Hey gparent. Thanks for your help. <br> <br>Unfortunately it didn’t work for me. My serve key is stored in etc/nginx/ssl/, let’s say it is called example.com.key, so I’ve tried to remove the passphrase from it using the command you suggested such as: <br> <br>openssl rsa -in /etc/nginx/ssl/example.com.key out -/etc/nginx/ssl/example.com.key.decrypted <br> <br>Could you please tell me if is it right? <br> <br>I’ve restart nginx after executing the command but I’m still being asked for the passphrase.

The passphrase is not on the certificate or CSR, so you never removed anything. It is on the key file. <br> <br>openssl rsa -in /path/to/keyfile out -/path/to/keyfile.decrypted <br> <br>will do what you want.