Generate a self-signed certifcate for a DNS name, and add it to the macOS Keychain as a trusted cert.
I wrote this in about 5 minutes - it is messy, it is badly coded, but it works for the purpose.
Just edit the domains array in the file to add the domain(s) you'd like to generate for.