Skip to content

Remove password for a password protected SSL private key

homepage-banner

SSL certificates are used to secure websites and other online services. A private key is an essential component of an SSL certificate as it is used to encrypt and decrypt data sent over the internet. It is essential to protect the private key with a password to prevent unauthorized access. However, there may be situations when you need to remove the password from the SSL private key. In this blog post, we will discuss how to remove the password for a password-protected SSL private key.

Verify the private key is password protected

PKCS#8 format

----BEGIN ENCRYPTED PRIVATE KEY-----
......BASE64 Private KEY......
-----END ENCRYPTED PRIVATE KEY-----

Openssl ASN format

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info:DES-EDE3-CBC,4D5D1AF13367D726
......BASE64 Private KEY......
-----END RSA PRIVATE KEY-----

Remove password

openssl rsa -in encryedprivate.key -out unencryedprivate.key

Testing the new private key

After creating the new private key file without the password, you need to test it to ensure it is working correctly. Follow the steps below to test the new private key:

Run the following command to check the SSL certificate:

openssl x509 -noout -modulus -in server.crt | openssl md5

Run the following command to check the private key:

openssl rsa -noout -modulus -in server.key | openssl md5

Compare the output from both commands. If the output is the same, the private key is working correctly.

Feedback







Small world. Big idea!
  • Welcome to visit the knowledge base of SRE and DevOps!
  • License under CC BY-NC 4.0
  • Made with Material for MkDocs and improve writing by generative AI tools
  • Copyright issue feedback me#imzye.com, replace # with @