servers:windows:nginx:lets_encrypt
This is an old revision of the document!
Table of Contents
Information
Prerequisites
Install
Python
- Last tested:
python-3.13.3-amd64.exe
- Install
pip
Certbot
"%LocalAppData%\Programs\Python\Python313\Scripts\pip.exe" install "certbot"
Update
"%LocalAppData%\Programs\Python\Python313\Scripts\pip.exe" install --upgrade "certbot"
Settings
MKDIR "%SystemDrive%\www\certbot"
"notepad.exe" "%SystemDrive%\www\certbot\cli-custom.ini"
verbose = true text = true non-interactive = true standalone = true force-renewal = true agree-tos = true ########## #CHANGEME# ########## email = espionage724@x ########## #CHANGEME# ########## no-eff-email = true rsa-key-size = 4096 redirect = true hsts = true uir = true staple-ocsp = false domains = realmofespionage.xyz, blog.realmofespionage.xyz, files.realmofespionage.xyz, media.realmofespionage.xyz, wiki.realmofespionage.xyz # End
Obtain Certs Test
"netsh.exe" advfirewall firewall add rule name="Certbot (Standalone)" dir="in" action="allow" program="%LocalAppData%\Programs\Python\Python313\python.exe" protocol="tcp" localport="80"
"%LocalAppData%\Programs\Python\Python313\Scripts\certbot.exe" "certonly" --config "%SystemDrive%\www\certbot\cli-custom.ini" --dry-run
"netsh.exe" advfirewall firewall delete rule name="Certbot (Standalone)"
Scripts
2025/03/15: TODO: Certbot needs admin for symlinks; possibly needs different scripting 3), and updated for temp firewall rule
MKDIR "%SystemDrive%\www\scripts\certbot"
explorer "%SystemDrive%\www\scripts\certbot"
Renewal
notepad "%SystemDrive%\www\scripts\certbot\Renewal.bat"
:: Stop nginx CALL "%SystemDrive%\www\scripts\nginx\Stop.bat" :: Renew Certs "%LocalAppData%\Programs\Python\Python313\Scripts\certbot.exe" "certonly" --config "%SystemDrive%\www\certbot\cli-custom.ini" --quiet :: Start nginx CALL "%SystemDrive%\www\scripts\nginx\Start.bat" :: End
"%SystemDrive%\www\scripts\certbot\Renewal.bat"
Test Renewal
"notepad.exe" "%SystemDrive%\www\scripts\certbot\Renewal-test.bat"
:: Stop nginx CALL "%SystemDrive%\www\scripts\nginx\Stop.bat" :: Renew Certs "netsh.exe" advfirewall firewall add rule name="Certbot (Standalone)" dir="in" action="allow" program="%LocalAppData%\Programs\Python\Python313\python.exe" protocol="tcp" localport="80" "%LocalAppData%\Programs\Python\Python313\Scripts\certbot.exe" "certonly" --config "%SystemDrive%\www\certbot\cli-custom.ini" --quiet "netsh.exe" advfirewall firewall delete rule name="Certbot (Standalone)" "explorer.exe" "%SystemDrive%\Certbot\archive\realmofespionage.xyz" "explorer.exe" "%SystemDrive%\www\certbot\certs" "notepad.exe" "%SystemDrive%\www\nginx\conf.d\ssl.conf" :: End
"%SystemDrive%\www\scripts\certbot\Renewal-test.bat"
Update
notepad "%SystemDrive%\www\scripts\certbot\Update.bat"
:: Update pip "%LocalAppData%\Programs\Python\Python313\python.exe" -m "pip" install --upgrade "pip" --quiet :: Update Certbot "%LocalAppData%\Programs\Python\Python313\Scripts\pip.exe" install --upgrade "certbot" --quiet :: End
"%SystemDrive%\www\scripts\certbot\Update.bat"
Shortcuts
Desktop
- Right-click Desktop → New → Shortcut
Renewal
"%SystemDrive%\www\scripts\certbot\Renewal.bat"
Certbot Renewal
3)
new certs filenames add #; tar archives, remove it, pull-in new certs; test with --test-certs
C:/www/wiki/data/attic/servers/windows/nginx/lets_encrypt.1748965172.txt.gz · Last modified: by Sean Rhone