delete_self_signed_cert
This script will delete a private key key.pem and a self-signed certificate cert.pem.
The following parameters are optional:
c-
the common name (
localhostif not given) of the certificate d-
the directory (
$PWDif not given) containing the key and certificate; the directory will be also deleted if empty and not$PWD
On macOS, the certificate will be removed from the "login" keychain also.
|
Chrome and Safari need no further configuration. For Firefox, the old certificate has to be deleted manually. Docker needs to be restarted. |
|
Copy the script into your Node.js project and add it as a custom script to your package.json
|
Usage
$ scripts/cert/delete_self_signed_cert.sh
Removing 'localhost' certificate from keychain /Users/example/Library/Keychains/login.keychain-db ...
$ scripts/cert/delete_self_signed_cert.sh -d ~/.local/secrets/certs/localhost
Removing 'localhost' certificate from keychain /Users/example/Library/Keychains/login.keychain-db ...
$ scripts/cert/delete_self_signed_cert.sh -d ~/.local/secrets/certs/https.internal -c https.internal
Removing 'https.internal' certificate from keychain /Users/example/Library/Keychains/login.keychain-db ...