This is a manual authentication hook for Certbot that is specifically designed for DNS-01 validation and integration with Namecheap. This project has been modified and extended based on trwnh/namecheap. Additionally, this new version of the code has been generated after communicating the requirements with ChatGPT.
Automated polling of DNS TXT records through dns.resolver, eliminating the need to wait for a specific length of time. The script proceeds to the next step as soon as it verifies the record correctly.
- Python 3
- Requests
- BeautifulSoup
- lxml
- dns.resolver
- Certbot
- Namecheap API Key
- Please make sure that your username/API KEY/CLIENT IP key is configured within the code.
- Edit your existing renewal configuration file, typically found at
/etc/letsencrypt/renewal/your_domain.com.conf
, and ensure that it includes the following settings:
[renewalparams]
account = YOUR_ACCOUNT_ID
authenticator = manual
server = https://acme-v02.api.letsencrypt.org/directory
pref_challs = dns-01,
manual_auth_hook = /path/to/this/script
manual_public_ip_logging_ok = True
If You Are Creating a New Certificate, Run the following command:
sudo certbot certonly \
--preferred-challenges=dns \
--manual \
--manual-auth-hook=/path/to/this/script \
--agree-tos \
-d your_domain.com,*.your_domain.com
# You can also consider using the --dry-run parameter to not consume actual quota.
- Renewal Certificate You should be able to run certbot renew afterward, and the settings will be remembered for future renewals.
- Original Author: trwnh/namecheap
- ChatGPT for code modifications and README guidance.
If you have any questions or ideas related to this project, please feel free to share them with me. Make appropriate modifications according to your needs. Hope this is helpful!
This project is licensed under the GNU Affero General Public License v3.0.