For anyone finding this wondering how to manually update ca-root-nss.crt because the current version isn't working I figured I'd post this. This is a last resort if updating the jail and ca-roos-nss package didn't fix your problem. Those are real solutions, this is bandaid that you may have to keep re-applying.
Find a way to identify the specific cert you want to remove. In this case, it was the DST_Root_CA_X3 cert that expired on 9/30/21 and for whatever reason Mono still tried to use it.
First up, removing it. Use your favorite text editor and find the lines to prune. For me, that's nano so...
Code:
nano /usr/local/share/certs/ca-root-nss.crt
Next up is doing a search for the marker we're looking for. Crtl+W does the trick in Nano, and I used the date in question "Sep 30".
Read the header data and confirm you're looking at the right one. Once you're definite, delete everything from "Certificate:" to "-----END CERTIFICATE------"
Save the file, Crtl+X in nano.
And to sync our change back to mono, we need to tell it to update manually.
Code:
cert-sync /usr/local/share/certs/ca-root-nss.crt
Give a try whatever wasn't working that made you aware you had a cert problem. Working? Then move on and remember after your next pkg upgrade you may need to fix it again if the cert source hasn't been updated to remove it.
Not working? Alright then we need to append a new valid cert for whatever you're doing and you need it in PEM or CRT format (CRT is just a bunch of PEMs appended into one file). This is also how you would add in any private certs you've created to the keystore. This part is super simple assuming you know where to find the cert. In this case, it's easy since we know it's a Let's Encrypt cert we want. So off to their site where we find links to their current active certs.
This page describes all of the current and relevant historical Certification Authorities operated by Let’s Encrypt. Note that a CA is most correctly thought of as a key and a name: any given CA may be represented by multiple certificates which all contain the same Subject and Public Key...
letsencrypt.org
What we want is that cross-signed cert. This is how Let's Encrypt is extending service on those certs. So download it to a decent location then we'll append it to the end of our cert file.
Code:
cd /usr/local/share/certs/
fetch https://letsencrypt.org/certs/isrg-root-x1-cross-signed.pem
cat isrg-root-x1-cross-signed.pem >> ca-root-nss.crt
cert-sync /usr/local/share/certs/ca-root-nss.crt