Last active
November 26, 2022 13:21
-
-
Save messeb/7ed6a4a8609e9023db907e0567430d28 to your computer and use it in GitHub Desktop.
Let's Encrypt certification creation on macOS
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
## Create Let's Encrypt certificate for DOMAIN and www subdomain of DOMAIN. | |
DOMAIN=example.com | |
[email protected] | |
.PHONY: default install generate | |
default: install | |
install: | |
brew update | |
brew install certbot | |
generate: | |
mkdir -p lets-encrypt | |
certbot certonly --key-type rsa -d $(DOMAIN) -d www.$(DOMAIN) --email $(EMAIL) --preferred-challenges=dns --manual --config-dir lets-encrypt --work-dir lets-encrypt --logs-dir lets-encrypt | |
package: | |
openssl pkcs12 -export -out lets-encrypt/archive/$(DOMAIN)/certificate.pfx -inkey lets-encrypt/archive/$(DOMAIN)/privkey1.pem -in lets-encrypt/archive/$(DOMAIN)/cert1.pem -certfile lets-encrypt/archive/$(DOMAIN)/chain1.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment