Last active
April 2, 2025 05:35
-
-
Save PierBover/fb1674b41233714bbf3adb950b2752d9 to your computer and use it in GitHub Desktop.
Bash script to create SSL certs for dotnet in 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
# create the pem files | |
openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' -keyout mydomain-key.pem -out mydomain-cert.pem | |
mkcert -install | |
mkcert -key-file mydomain-key.pem -cert-file mydomain-cert.pem 127.0.0.1 localhost "*.mydomain.dev" mydomain.dev | |
echo "Certs created!" | |
# Convert PEM files to PFX format | |
openssl pkcs12 -export \ | |
-out mydomain.pfx \ | |
-inkey mydomain-key.pem \ | |
-in mydomain-cert.pem \ | |
-password pass:"secretpassword" | |
echo "Conversion complete! Created mydomain.pfx" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment