Here’s a great tutorial on how to do so. The only thing I had to change was importing the certificate from Keychain Access instead of double-clicking the certificate. Otherwise, it works fine, and the screenshots are very helpful!
If you prefer the terminal, you can save yourself a few steps at the end by using this command to add the certificate to the system keychain:
sudo security add-trusted-cert -d -r trustRoot -k “/Library/Keychains/System.keychain” /PATH/TO/CERTIFICATEFILE/ACTUALCERTIFICATE.cer