All Projects → Tondas → LetsEncrypt

Tondas / LetsEncrypt

Licence: GPL-3.0 license
C# layer for generation of wildcard Let's Encrypt SSL certificates

Programming Languages

C#
18002 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to LetsEncrypt

acme-dns-01-cloudflare
Cloudflare DNS for Let's Encrypt / ACME dns-01 challenges with Greenlock.js and ACME.js
Stars: ✭ 13 (-80.6%)
Mutual labels:  letsencrypt, acme-dns, acme-v2
Docker Letsencrypt Nginx Proxy Companion
Automated ACME SSL certificate generation for nginx-proxy
Stars: ✭ 6,350 (+9377.61%)
Mutual labels:  letsencrypt, acme-protocol, acme-v2
ght-acme.sh
Shell script to sign certificate by the letsencrypt CA
Stars: ✭ 31 (-53.73%)
Mutual labels:  letsencrypt, certificate, acme-v2
ACMECert
PHP client library for Let's Encrypt (ACME v2 - RFC 8555)
Stars: ✭ 83 (+23.88%)
Mutual labels:  letsencrypt, certificate, acme-v2
letsencrypt-inwx
A small cli utility for automating the letsencrypt dns-01 challenge for domains hosted by inwx.
Stars: ✭ 43 (-35.82%)
Mutual labels:  letsencrypt, certificate, wildcard
acme-companion
Automated ACME SSL certificate generation for nginx-proxy
Stars: ✭ 6,434 (+9502.99%)
Mutual labels:  letsencrypt, acme-protocol, acme-v2
Ansible Letsencrypt
Ansible role for LetsEncrypt
Stars: ✭ 66 (-1.49%)
Mutual labels:  letsencrypt, certificate
Acmesharp
An ACME client library and PowerShell client for the .NET platform (Let's Encrypt)
Stars: ✭ 1,161 (+1632.84%)
Mutual labels:  letsencrypt, certificate
Certificaat
General-purpose ACME client
Stars: ✭ 88 (+31.34%)
Mutual labels:  letsencrypt, certificate
Getssl
obtain free SSL certificates from letsencrypt ACME server Suitable for automating the process on remote servers.
Stars: ✭ 1,687 (+2417.91%)
Mutual labels:  letsencrypt, certificate
Chef Acme
Chef cookbook to request SSL certificates at Let's Encrypt
Stars: ✭ 98 (+46.27%)
Mutual labels:  letsencrypt, certificate
Node Acme Lambda
Use AWS Lambda to manage SSL certificates for ACME providers like Let's Encrypt.
Stars: ✭ 120 (+79.1%)
Mutual labels:  letsencrypt, certificate
Ghost Nginx Ssl Docker
Ghost blog with nginx proxy, lets encrypt ssl in a docker-compose (ready for production)
Stars: ✭ 45 (-32.84%)
Mutual labels:  letsencrypt, certificate
Certbot
Certbot is EFF's tool to obtain certs from Let's Encrypt and (optionally) auto-enable HTTPS on your server. It can also act as a client for any other CA that uses the ACME protocol.
Stars: ✭ 28,541 (+42498.51%)
Mutual labels:  letsencrypt, certificate
Acme client
Java ACME Client application
Stars: ✭ 77 (+14.93%)
Mutual labels:  letsencrypt, certificate
Certbot Letencrypt Wildcardcertificates Alydns Au
certbot'renewing letencrypt certificate plugin - automatic verification aliyun/tencentyun/godaddy dns
Stars: ✭ 839 (+1152.24%)
Mutual labels:  letsencrypt, certificate
Docker Nginx Gunicorn Flask Letsencrypt
Boilerplate code for setting up Nginx + Gunicorn + Flask + automated LetsEncrypt certificates (https) using docker-compose.
Stars: ✭ 117 (+74.63%)
Mutual labels:  letsencrypt, certificate
Acme Plugin
🔏 ACME protocol plugin for Ruby on Rails applications
Stars: ✭ 190 (+183.58%)
Mutual labels:  letsencrypt, certificate
Nginx Proxy Automation
Automated docker nginx proxy integrated with letsencrypt.
Stars: ✭ 2,302 (+3335.82%)
Mutual labels:  letsencrypt, certificate
Acme Nginx
python acme client for nginx
Stars: ✭ 248 (+270.15%)
Mutual labels:  letsencrypt, certificate

Let's Encrypt C# library

NuGet NuGet

Solution consist of 2 projects:

  • LetsEncrypt.Client (.Net Standard Library - available as nuget package)
  • LetsEncrypt.ConsoleApp (.Net Core Console application)

LetsEncrypt.Client

LetsEncrypt.Client is simple and straightforward C# implementation of ACME client for Let's Encrypt certificates. Library is based on .NET Standard 2.1+. It uses Let's Encrypt v2 API and this library is primary oriented for generation of wildcard certificates as .pfx.

LetsEncrypt.ConsoleApp

LetsEncrypt.ConsoleApp is C# implementation|usage of previous LetsEncrypt.Client library based on .NET Core 3.1. It is simple console application which generates Let's Encrypt certificates.

LetsEncrypt.Client

Usage

Add LetsEncrypt.Client as nuget package (or manual .dll reference) to your project.

First step is to create client object to specific environment (staging or production ... use staging environment first to avoid rate limits):

var acmeClient = new AcmeClient(ApiEnvironment.LetsEncryptV2Staging);

... and let's start:

Account

Create new account:

var account = await acmeClient.CreateNewAccountAsync("[email protected]");

Order

When you want to generate wildcard certificate, I recommend to specify these 2 identifiers: domain.com and *.domain.com as follows:

var order = await acmeClient.NewOrderAsync(account, new List<string> { "domain.com", "*.domain.com" });

Authorization

Wildcard certificates must by authorized by DNS challenge only. So go one by one and create DNS TXT record.

var challenges = await acmeClient.GetDnsChallenges(account, order);

foreach (var challenge in challenges)
{  
    var dnsText = challenge.VerificationValue;
    // value can be e.g.: eBAdFvukOz4Qq8nIVFPmNrMKPNlO8D1cr9bl8VFFsJM

    // Create DNS TXT record e.g.:
    // key: _acme-challenge.your.domain.com 
    // value: eBAdFvukOz4Qq8nIVFPmNrMKPNlO8D1cr9bl8VFFsJM
}
Example no.1:

You want to generate simple certificate for:

  • domain.com

DNS TXT must contains 1 record:

  • key: _acme-challenge.domain.com, value : dnsText of challenge for domain.com
Example no.2:

You want to generate simple certificate with these subject names:

  • domain.com
  • blog.domain.com

DNS TXT must contains 2 records :

  • key: _acme-challenge.domain.com, value : dnsText of challenge for domain.com
  • key: _acme-challenge.blog.domain.com, value : dnsText of challenge for blog.domain.com
Example no.3:

You want to generate wildcard certificate with these subject names:

  • domain.com
  • *.domain.com

DNS TXT must contains 2 records:

  • key: _acme-challenge.domain.com, value : dnsText of challenge for domain.com
  • key: _acme-challenge.domain.com, value : dnsText of challenge for *.domain.com

Yes, *.domain.com has the same key as domain.com !!!

Validation

All challenges must be validated:

foreach (var challenge in challenges)
{
    // Do a validation
    await acmeClient.ValidateChallengeAsync(account, challenge);

    // Verify status 
    var freshChallenge = await acmeClient.GetChallengeAsync(account, challenge);
    if (freshChallenge.Status == ChallengeStatus.Invalid)
    {
        throw new Exception("Something is wrong with your DNS TXT record(s)!");
    }
}

Certificate

Finally, generate certificate:

var certificate = await acmeClient.GenerateCertificateAsync(account, order, "domain.com");
var password = "YourSuperSecretPassword";

// Generate certificate in pfx format
var pfx = certificate.GeneratePfx(password);

// Generate certificate in crt format
var crt = certificate.GenerateCrt(password);

// Generate certificate in PEM format 
var crtPem = certificate.GenerateCrtPem(password);

// Generate certificate private key in PEM format 
var keyPem = certificate.GenerateKeyPem();

Enjoy! Any feedback is highly appreciated!


LetsEncrypt.ConsoleApp

Add your correct values to .config file :

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="ContactEmail" value="[email protected]" />
        <add key="Domains" value="domain.com, *.domain.com" />
        <add key="CertificateFileName" value="Domain.com" />
        <add key="CertificatePassword" value="YourSuperSecretPassword" />
    </appSettings>
</configuration>

and run console application LetsEncrypt.ConsoleApp.exe

Enjoy!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].