I tryed using this way, DO NOT TRY YOURSELF, I MAY HAVE DAMAGED MY INSTALLATION:
# make the root file system writable
sudo mount -o remount,rw /
# copy certificate
cp /home/.../nextcloud.pem /usr/share/ca-certificates
# run this command
dpkg-reconfigure ca-certificates
I tinkered around a little bit and moved the certificate between /usr/share/ca-certificates
and /usr/share/ca-certificates/mozilla
. I also renamed it "nextcloud.pem", "cert.pem" or "nextcloud.crt".
After the dpkg-reconfigure ca-certificates
there is a question shown if I want to trust the new certificates. The answer-options are "yes", "no" and "ask". I ran the command multiple times. Sometimes I choose "yes", sometimes "ask". The next page shows a list with all the certificates. Unfortunatly the screen is croped and I can't read all the text. But I can select my new certificate.
I tryed navigating to https://192.168.x.x:1234 (my nextcloud instance) in the morph-browser to check if there is a warning about an untrusted certificate. Unfortunatly there still is. And additionally sudo dpkg-reconfigure ca-certificates
now shows the error message /usr/sbin/dpkg-reconfigure: ca-certificates is broken or not fully installed
and exits after the error.
I am not sure where I went wrong with my tinkering. Any Ideas of how to repair the damage in the sudo dpkg-reconfigure ca-certificates
?