User Tools

Site Tools


servers:windows:nginx:lets_encrypt

Information

Prerequisites

Install

Python

  • Install pip 4)

Certbot

"%LocalAppData%\Programs\Python\Python314\Scripts\pip.exe" install "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"

##################################################
email = espionage724@x
##################################################

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, forums.realmofespionage.xyz, media.realmofespionage.xyz, wiki.realmofespionage.xyz, social.realmofespionage.xyz, test.realmofespionage.xyz"

# End

Obtain Certs Test

"netsh.exe" advfirewall firewall add rule name="Certbot (Standalone)" dir="in" action="allow" program="%LocalAppData%\Programs\Python\Python314\python.exe" protocol="tcp" localport="80"
"%LocalAppData%\Programs\Python\Python314\Scripts\certbot.exe" "certonly" --config "%SystemDrive%\www\certbot\cli-custom.ini" --dry-run
"netsh.exe" advfirewall firewall delete rule name="Certbot (Standalone)"

Scripts

MKDIR "%SystemDrive%\www\scripts\certbot"
"explorer.exe" "%SystemDrive%\www\scripts\certbot"

Renewal

"notepad.exe" "%SystemDrive%\www\scripts\certbot\Renewal.bat"
@echo off

CALL "%SystemDrive%\www\scripts\certbot\Update.bat"

CALL "%SystemDrive%\www\scripts\nginx\Stop.bat"

"netsh.exe" advfirewall firewall add rule name="Certbot (Standalone)" dir="in" action="allow" program="%LocalAppData%\Programs\Python\Python314\python.exe" protocol="tcp" localport="80"
"%LocalAppData%\Programs\Python\Python314\Scripts\certbot.exe" "certonly" --config "%SystemDrive%\www\certbot\cli-custom.ini" --quiet
"netsh.exe" advfirewall firewall delete rule name="Certbot (Standalone)"

CALL "%SystemDrive%\www\scripts\nginx\Start.bat"

:: End
"%SystemDrive%\www\scripts\certbot\Renewal.bat"

Update

"notepad.exe" "%SystemDrive%\www\scripts\certbot\Update.bat"
@echo off

"%LocalAppData%\Programs\Python\Python314\python.exe" -m "pip" install --upgrade "pip" --quiet

"%LocalAppData%\Programs\Python\Python314\Scripts\pip.exe" install --upgrade "certbot" --quiet

:: End
"%SystemDrive%\www\scripts\certbot\Update.bat"

Task Scheduler

taskschd.msc

Renewal

  • Weekly → Recur every 1 weeks on Sunday
  • 7:00:00 AM
Certbot Renewal
"%SystemDrive%\www\scripts\certbot\Renewal.bat"
3)
2025/11/13: python-3.15.0a1-amd64.exe needed a VC++ package for certbot and abbodi1406/vcredist didn't cover it
4)
nothing else (admin, PATH, etc) is required and can be unchecked
/srv/www/wiki/data/pages/servers/windows/nginx/lets_encrypt.txt · Last modified: by Sean Rhone

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki