We help IT Professionals succeed at work.

Convert SSL cert to TXT

sara2000
sara2000 used Ask the Experts™
on
I have a CSR file and got the certificate from our internal CA for an appliance. How do I convert this certificate as a .txt file with BEGIN CERTIFICATE  and END CERTIFICATE so I can paste this text to an appliance to install the cert?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
David FavorFractional CTO
Distinguished Expert 2018

Commented:
Provide all your steps, as your cert generation step has almost surely generated a .cert or .fullchain file which you'll use.

Tip: Independent of what tool you use + file extensions your tool generates (they all seems to produces slightly different extensions), all the produced files are human readable text.

For example, https://www.experts-exchange.com/questions/29164536/SSL-Solution-for-Multi-Domain-Multi-Host.html discusses using LetsEncrypt to generate certs.

When finished, you'll have a list of cert files.

For example, here are the LetsEncrypt generated files. Note there's no .csr file as LetsEncrypt automatically generates this file, so you never see a .csr file... unless you really dig for it...

lxd: net14-dns-ns11 # lsd -l /etc/letsencrypt/live/davidfavor.com/*
-rw-r--r-- 1 root root 682 Jul  3  2018 /etc/letsencrypt/live/davidfavor.com/README
lrwxrwxrwx 1 root root  39 Dec 25 19:04 /etc/letsencrypt/live/davidfavor.com/cert.pem -> ../../archive/davidfavor.com/cert10.pem
lrwxrwxrwx 1 root root  40 Dec 25 19:04 /etc/letsencrypt/live/davidfavor.com/chain.pem -> ../../archive/davidfavor.com/chain10.pem
lrwxrwxrwx 1 root root  44 Dec 25 19:04 /etc/letsencrypt/live/davidfavor.com/fullchain.pem -> ../../archive/davidfavor.com/fullchain10.pem
lrwxrwxrwx 1 root root  42 Dec 25 19:04 /etc/letsencrypt/live/davidfavor.com/privkey.pem -> ../../archive/davidfavor.com/privkey10.pem

Open in new window


All these files have .pem extensions + the files are actually all human readable, plain text files... albeit, containing long strings of text...
How do I convert this certificate as a .txt file with BEGIN CERTIFICATE  and END CERTIFICATE so I can paste this text to an appliance to install the cert?

As long as the certificate is Base64 encoded open the .crt/.cert/.pem in a text editor. There is no need to convert it to anything.

If it is a binary encoded (DER) certificate you'll want to convert it to Base64 using a tool like OpenSSL.

Author

Commented:
The cert was issued by internal CA. I was able to convert it to pem file using openssl.