0

I'm not a linux user, so there's a problem with certificate importing. I have couple of .cer files and using windows it worked perfectly, i just used X509Store.Add() method and a new certificate appears in the store, but in linux nothing happens. Is there a way to fix this behavior somehow ? Thanks!

wewordash
  • 11
  • 4

1 Answers1

0

Files with .cer extension are from the Windows world and they can have the PEM or the DER format. You can use openssl to convert them to PEM format with one of this lines (depending on the format, one of them will work):

openssl x509 -inform DER -in certificate.cer -out certificate.crt

openssl x509 -inform PEM -in certificate.cer -out certificate.crt

In an ubuntu server, certificates are expected to be in /etc/ssl/certs, and private keys in /etc/ssl/private. If you want to install a certificate from a CA, you should copy the certificate.crt obtained with openssl to /usr/local/share/ca-certificates and execute update-ca-certificates. This tool copies the certificate to its proper place and allows updating CA certificates preserving the one you have installed

sudo cp certificate.crt /usr/local/share/ca-certificates
sudo update-ca-certificates
J.M. Robles
  • 614
  • 5
  • 9