Created
May 29, 2021 15:36
-
-
Save Abdelkrim/af2060e43aca086ff99bc364b80e01a9 to your computer and use it in GitHub Desktop.
use certbot to generate a self signed certificate and convert a .pem into .pfx
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
#!/bin/bash | |
# https://dev.to/ope/securing-your-azure-web-app-with-let-s-encrypt-4g99 | |
echo please indicate the domaine name i.e. alt-f1.be | |
read domain_name | |
# domain_name=betterop.alt-f1.be | |
sudo certbot certonly -d $domain_name --manual --preferred-challenges dns | |
SOURCE=/etc/letsencrypt/live/$domain_name | |
sudo cp $SOURCE/{cert.pem,privkey.pem,chain.pem} . | |
username=abo | |
# make the files your own | |
# assuming your username is ope... | |
sudo chown $username *.pem | |
# finally, create the private certificate, | |
# saving it to "certificate.pfx" | |
openssl pkcs12 -export -out $domain_name.certificate.pfx -inkey privkey.pem -in cert.pem -certfile chain.pem | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment