Created
August 2, 2021 07:58
-
-
Save melehin/e2446a9503d688a782b84150e4930407 to your computer and use it in GitHub Desktop.
using acme-tiny with apache2. split signed_chain.crt into separate files.
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
#!/bin/bash | |
cd /root/acme_tiny | |
python ./acme_tiny.py --account-key ./account.key --csr ./domain.csr --acme-dir /var/www/challenges/ > ./signed_chain.crt.tmp || exit | |
mv ./signed_chain.crt.tmp ./signed_chain.crt | |
# Split signed_chain.crt into two files domain_signed.pem and chain.pem | |
# for apache2 support | |
python -c 'f = open("signed_chain.crt", "r"); l = f.read(); f.close(); end = "\n\n"; certs = l.split(end); f = open("domain_signed.pem", "w"); f.write(certs[0]+"\n"); f.close(); f = open("chain.pem", "w"); f.write(end.join(certs[1:])+"\n"); f.close()' | |
/etc/init.d/apache2 reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment