Skip to content

Instantly share code, notes, and snippets.

@messeb
Last active November 26, 2022 13:21
Show Gist options
  • Save messeb/7ed6a4a8609e9023db907e0567430d28 to your computer and use it in GitHub Desktop.
Save messeb/7ed6a4a8609e9023db907e0567430d28 to your computer and use it in GitHub Desktop.
Let's Encrypt certification creation on macOS
## Create Let's Encrypt certificate for DOMAIN and www subdomain of DOMAIN.
DOMAIN=example.com
EMAIL=noreply@example.com
.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