Last active
September 13, 2023 06:38
-
-
Save sahibalejandro/3c48d10058afccd6c705caabdb88660a to your computer and use it in GitHub Desktop.
Generate PFX file from Let's Encrypt PEM files for Azure Application Service
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
# STEP 1 | |
# Frist, generate PEM files using certbot docker image | |
docker run --rm -it -v ".:/etc/letsencrypt" certbot/certbot certonly --manual --preferred-challenges dns -d "domain.com" -d "*.domain.com" | |
# Follow the certbot instructions | |
# Remember that multiple TXT records with the same host are allowed | |
# so you can add TXT record for naked and wildcard validations. | |
# STEP 2 | |
# Generate FPX file using Ubuntu docker image | |
docker run --rm -it -v ".:/home/certificates" ubuntu:focal | |
# Once inside the container run: | |
apt-get update | |
apt-get install openssl | |
cd /home/certificates | |
# Navigate to where your PEM files are located and run: | |
openssl pkcs12 -export -out certificate.pfx -inkey privkey.pem -in fullchain.pem | |
# STEP 3 | |
# Got to your Azure Application Service and add the PFX file. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment