-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds cert setup for macOS. Closes #49
- Loading branch information
1 parent
d97a798
commit 20107fe
Showing
6 changed files
with
84 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
set -e | ||
|
||
echo -e "\nDev Proxy uses a self-signed certificate to intercept and inspect HTTPS traffic.\nUpdate the certificate in your Keychain so that it's trusted by your browser? (Y/n)? \c" | ||
read -n 1 answer | ||
|
||
if [ "$answer" = "n" ]; then | ||
echo -e "\n\033[1;33mTrust the certificate in your Keychain manually to avoid errors.\033[0m\n" | ||
exit 1 | ||
fi | ||
|
||
echo -e "\n" | ||
|
||
cert_name="Dev Proxy CA" | ||
# export cert from keychain to PEM | ||
echo "Exporting Dev Proxy certificate..." | ||
security find-certificate -c "$cert_name" -a -p > dev-proxy-ca.pem | ||
# add trusted cert to keychain | ||
echo "Updating Dev Proxy trust settings..." | ||
security add-trusted-cert -r trustRoot -k ~/Library/Keychains/login.keychain-db dev-proxy-ca.pem | ||
# remove exported cert | ||
echo "Cleaning up..." | ||
rm dev-proxy-ca.pem | ||
echo -e "\033[0;32mDONE\033[0m\n" |