Firstly, I know most of the Ub3R's here will know the process for this, but for any newbie that might want to know.. If you already have your Cert setup then it want to be exported into a PFX format and contain the Private Key.
Open a Terminal windows and browse to the location of the newly copied PFX file. For me it was “Term/Downloads/Certificates“.
In the command Windows we now use the “openssl” tool to perform a couple of tasks, the first to extract the “.pem” or key file, then second the actual certificate “.crt” file.
Export the Private Key
openssl pkcs12 -in Root.pfx -nocerts -out Root.pem -nodes
Export the Certificate
openssl pkcs12 -in Root.pfx -nokeys -out Root.crt -nodes
These commands will ask for the PFX password and then export the two files. Now we have the root certificate and do the same
Export the Private Key
openssl pkcs12 -in Website.pfx -nocerts -out Website.pem -nodes
Export the Certificate
openssl pkcs12 -in Website.pfx -nokeys -out Website.crt -nodes
Now we have the individual files we need to import them into the system by using the following commands from the same location in the Terminal window:
Import Root Certificate
sudo cp Root.crt /usr/local/share/ca-certificates/Root.crt
Import Website Certificate
sudo cp Website.crt /usr/local/share/ca-certificates/Website.crt
These will then import successfully, but to be able to bypass the security checks for the Certificates, we need to run one last step, which is to update the certificate cache.
sudo update-ca-certificates
That now completes adding the certificate to you machine.
Open a Terminal windows and browse to the location of the newly copied PFX file. For me it was “Term/Downloads/Certificates“.
In the command Windows we now use the “openssl” tool to perform a couple of tasks, the first to extract the “.pem” or key file, then second the actual certificate “.crt” file.
Export the Private Key
openssl pkcs12 -in Root.pfx -nocerts -out Root.pem -nodes
Export the Certificate
openssl pkcs12 -in Root.pfx -nokeys -out Root.crt -nodes
These commands will ask for the PFX password and then export the two files. Now we have the root certificate and do the same
Export the Private Key
openssl pkcs12 -in Website.pfx -nocerts -out Website.pem -nodes
Export the Certificate
openssl pkcs12 -in Website.pfx -nokeys -out Website.crt -nodes
Now we have the individual files we need to import them into the system by using the following commands from the same location in the Terminal window:
Import Root Certificate
sudo cp Root.crt /usr/local/share/ca-certificates/Root.crt
Import Website Certificate
sudo cp Website.crt /usr/local/share/ca-certificates/Website.crt
These will then import successfully, but to be able to bypass the security checks for the Certificates, we need to run one last step, which is to update the certificate cache.
sudo update-ca-certificates
That now completes adding the certificate to you machine.


![[Image: newnew3.gif]](https://i.postimg.cc/sf9jzyLM/newnew3.gif)