How to install a certificate in trusted

I am trying to install a certificate on my devices, but I must be missing a step because it keeps saying 0 added. Any assistance would be greatly appreciated.

mkdir /usr/share/ca-certificates/extras
cp /tmp/fortigate.crt /usr/share/ca-certificates/extras/fortigate.crt
dpkg-reconfigure -p critical ca-certificates
update-ca-certificates
0 added, 0 removed; done.

This is FROM resin/raspberrypi3-debian:stretch

I successsfully installed this using the same procedure on another debian machine, although that one was jessie, I am not aware of any differences that exist with the procedure.

Did you make any progress on this? I’m coming up against a similar problem.

Cheers
Al

Hi,

This is probably because you’re copying the certificate to the wrong place for updates. The certificate should be copied to /usr/local/share/ca-certificates/ (and ideally have the 0644 permissions). You don’t actually need to run dpkg-reconfigure ca-certificates after this, because any new certificate found in that directory is taken as a trusted root. Just run update-ca-certificates after adding it, and it will be added to the system store at /etc/ssl/certs.

If you’re using a Dockerfile, the following example should work fine:

COPY mycert.crt /usr/src/app/mycert.crt
RUN cp /usr/src/app/mycert.crt /usr/local/share/ca-certificates/ && update-ca-certificates

Obviously, if you’re doing this in a script at runtime, just do the same thing from whereever the location of the certificate is.

Best regards,

Heds