Created
January 30, 2019 15:17
-
-
Save mckelvin/26f3b6a7c368f0e1e9aae25909f55280 to your computer and use it in GitHub Desktop.
Generate self-signed certs for mitmproxy on macOS
This file contains hidden or 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
# Generate self-signed certificates for mitmproxy: | |
# mitmproxy-ca.pem | |
# mitmproxy-ca-cert.pem | |
# mitmproxy-dhparam.pem | |
# | |
# Usage: | |
# Put this make file in ~/.mitmproxy/Makfile and run make | |
all: mitmproxy-dhparam.pem mitmproxy-ca.pem mitmproxy-ca-cert.pem | |
mitmproxy-ca.pem: mitmproxy-ca.key mitmproxy-ca-cert.pem | |
cat mitmproxy-ca.key mitmproxy-ca-cert.pem > mitmproxy-ca.pem | |
mitmproxy-ca-cert.pem: mitmproxy-ca.key | |
openssl req -new -x509 -key mitmproxy-ca.key \ | |
-out mitmproxy-ca-cert.pem -days 3650 -subj /CN=MitmProxyReplaceMe | |
# Trust the cert we generated | |
sudo security add-trusted-cert -d -r trustRoot \ | |
-k /Library/Keychains/System.keychain mitmproxy-ca-cert.pem | |
mitmproxy-ca.key: | |
openssl genrsa -out mitmproxy-ca.key 2048 | |
mitmproxy-dhparam.pem: | |
openssl dhparam -out mitmproxy-dhparam.pem 2048 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment