I'm developing an app which with every restart generates new self-signed root certificate. Safari on my macOS always asks whether I want to proceed.
How can I make safari always trust any certificates from localhost?
I'm developing an app which with every restart generates new self-signed root certificate. Safari on my macOS always asks whether I want to proceed.
How can I make safari always trust any certificates from localhost?
The certificate needs to be signed by a trusted root certificate; I suspect your application is not obtaining the certificate this way.
Assuming the application generates a self-signed root certificate, the new certificate needs to be marked as trusted in macOS's Keychain. This can be done using the security
command line tool or through the Keychain Access application.
See Applescript or Automator service that automatically trusts certificates for a related question about automating the trusting of a root certificate.
For adding the certificate:
For local development, consider using a local Certificate Authority (CA) such as mkcert
.
security
command (automatically) after each run, and this command will add certificate to keychain?