How to convert a PFX certificate to a separate .key/.crt file so it can be used in an Synology Diskstation
Install the required programs:
- Download one of the win32 light OpenSSL: https://slproweb.com/products/Win32OpenSSL.html
- Install it.
- Make sure ”Visual C++ 2008 Redistributables” is installed.
This version of OpenSSL requires a “openssl.cnf” configuration file:
- Download http://www.tbs-certificats.com/openssl-dem-server-cert-thvs.cnf and rename it to “openssl.cnf” and save it in C:\OpenSSL-Win32\
- Start a CMD, go to c:\OpenSSL-Win32\bin and enter: “set OPENSSL_CONF=c:\OpenSSL-Win32\openssl.cnf”
Convert the file:
- Copy the .pxf certificate file to c:\OpenSSL-Win32\bin
- In CMD go to c:\OpenSSL-Win32\bin
- Type: openssl pkcs12 -in certname.pfx –nodes -nocerts -out key.key
- Type: openssl pkcs12 -in certname.pfx -nokeys -out certificate.crt
Clean the files:
- Open key.key in Wordpad or Notepad++ (NOT Notepad)
- Remove everything before —–BEGIN CERTIFICATE—– and everything after —–END CERTIFICATE—–
- Do the same for certificate.crt
You can now import the two files in your Synology Diskstation