LetsencryptCert 4.0.5

dotnet tool install --global LetsencryptCert --version 4.0.5                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local LetsencryptCert --version 4.0.5                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=LetsencryptCert&version=4.0.5                
nuke :add-package LetsencryptCert --version 4.0.5                

UwebServerCert

LetsEncrypt bot to automatically create an LetsEncrypt certificate for a Web Server

Installation

dotnet tool install LetsencryptCert --global

Executing the tool for the first time

Copy cert.json to current directory with following content:

{
    "account": "<account@domain.de>",
    "domains": [
        "<domain 1>", "<domain 2>", "<domain 3>"
    ],
    "data": {
        "CountryName": "<my country>",
        "State": "<my state",
        "Locality": "<my locality>",
        "Organization": "<my organization>",
        "OrganizationUnit": "<my organization unit>",
        "CommonName": "<my common name, main domain>"
    }
}

LetsencryptCert -create

This lets LetsencryptCert create an account.

Create a file letsencrypt-uweb in /etc (Linux) or c:\program data\letsencrypt-uweb (Windows). This text file should contain a password for the to be created pfx certificate.

Obtaining certificate (test mode)

After executing the tool for the first time and having created an account, you can obtain a certificate from LetsEncrypt by running the tool:

LetsencryptCert

Your webserver has to serve the token to LetsEncrypt.

Obtaining certificate

To get a secure certificate, you have to set the command line argument -prod:

LetsencryptCert -create -prod
LetsencryptCert -prod

Executing tool every day (Linux)

crontab -e

Append

PATH=$PATH:/home/pi/.dotnet/tools
DOTNET_ROOT=/home/pi/.dotnet
0 4 * * * LetsencryptCert > /home/pi/logs/LetsencryptCert.log 2>&1

This executes dns update every day at 4 AM (universal time). Last log is saved in /home/pi/logs/LetsencryptCert.log

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
4.0.5 164 3/29/2024
4.0.4 159 3/26/2024
4.0.3 172 3/24/2024
4.0.2 175 3/24/2024
4.0.1 165 3/23/2024
4.0.0 179 3/23/2024
3.0.0 234 11/21/2022

Converted to C#