Certes 2.3.1
See the version list below for details.
dotnet add package Certes --version 2.3.1
NuGet\Install-Package Certes -Version 2.3.1
<PackageReference Include="Certes" Version="2.3.1" />
paket add Certes --version 2.3.1
#r "nuget: Certes, 2.3.1"
// Install Certes as a Cake Addin
#addin nuget:?package=Certes&version=2.3.1
// Install Certes as a Cake Tool
#tool nuget:?package=Certes&version=2.3.1
Certes
Certes is an ACME client runs on .NET 4.5+ and .NET Standard 1.3+, supports ACME v2 and wildcard certificates. It is aimed to provide an easy to use API for managing certificates during deployment processes.
Usage
Install Certes nuget package into your project:
Install-Package Certes
or using .NET CLI:
dotnet add package Certes
Let's Encrypt is the primary CA we supported. It's recommend testing against staging environment before using production environment, to avoid hitting the rate limits.
Account
Creating new ACME account:
var acme = new AcmeContext(WellKnownServers.LetsEncryptStagingV2);
var account = await acme.NewAccount("admin@example.com", true);
// Save the account key for later use
var pemKey = acme.AccountKey.ToPem();
Use an existing ACME account:
// Load the saved account key
var accountKey = KeyFactory.FromPem(pemKey);
var acme = new AcmeContext(WellKnownServers.LetsEncryptStagingV2, accountKey);
var account = await acme.Account();
See API doc for additional operations.
Order
Place a wildcard certificate order (DNS validation is required for wildcard certificates)
var order = await acme.NewOrder(new[] { "*.your.domain.name" });
Generate the value for DNS TXT record
var authz = (await order.Authorizations()).First();
var dnsChallenge = await authz.Dns();
var dnsTxt = acme.AccountKey.DnsTxt(dnsChallenge.Token);
Add a DNS TXT record to _acme-challenge.your.domain.name
with dnsTxt
value.
For non-wildcard certificate, HTTP challenge is also available
var order = await acme.NewOrder(new[] { "your.domain.name" });
Authorization
Get the token and key authorization string
var authz = (await order.Authorizations()).First();
var httpChallenge = await authz.Http();
var keyAuthz = httpChallenge.KeyAuthz;
Save the key authorization string in a text file,
and upload it to http://your.domain.name/.well-known/acme-challenge/<token>
Validate
Ask the ACME server to validate our domain ownership
await challenge.Validate();
Certificate
Download the certificate once validation is done
var privateKey = KeyFactory.NewKey(KeyAlgorithm.ES256);
var cert = await order.Generate(new CsrInfo
{
CountryName = "CA",
State = "Ontario",
Locality = "Toronto",
Organization = "Certes",
OrganizationUnit = "Dev",
CommonName = "your.domain.name",
}, privateKey);
Export full chain certification
var certPem = cert.ToPem();
Export PFX
var pfxBuilder = cert.ToPfx(privateKey);
var pfx = pfxBuilder.Build("my-cert", "abcd1234");
Check the APIs for more details.
For ACME v1, please see the doc here.
CLI
The CLI is available as a dotnet global tool. .NET Core Runtime 2.1+ is required to use dotnet tools.
To install Certes CLI (you may need to restart the console session if this is the first dotnet tool installed)
dotnet tool install --global dotnet-certes
See CLI usage, or simply use the --help
option to get started
certes --help
Also check this AppVeyor script for renewing certificates on Azure apps.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Also check the changelog to see what's we are working on.
CI Status
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows |
.NET Core | netcoreapp1.0 netcoreapp1.1 netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard1.3 netstandard1.4 netstandard1.5 netstandard1.6 netstandard2.0 netstandard2.1 |
.NET Framework | net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen30 tizen40 tizen60 |
Universal Windows Platform | uap uap10.0 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
-
.NETFramework 4.5
- Newtonsoft.Json (>= 10.0.3)
- Portable.BouncyCastle (>= 1.8.1.4)
- System.ValueTuple (>= 4.4.0)
-
.NETFramework 4.7
- Newtonsoft.Json (>= 10.0.3)
- Portable.BouncyCastle (>= 1.8.1.4)
-
.NETStandard 1.3
- NETStandard.Library (>= 1.6.1)
- Newtonsoft.Json (>= 10.0.3)
- Portable.BouncyCastle (>= 1.8.1.4)
- System.ValueTuple (>= 4.4.0)
-
.NETStandard 2.0
- Newtonsoft.Json (>= 10.0.3)
- Portable.BouncyCastle (>= 1.8.1.4)
NuGet packages (21)
Showing the top 5 NuGet packages that depend on Certes:
Package | Downloads |
---|---|
FluffySpoon.AspNet.LetsEncrypt
Package Description |
|
LettuceEncrypt
Provides API for configuring ASP.NET Core to automatically generate HTTPS certificates. This configures your server to use the ACME protocol to connect with a certificate authority (CA), such as Let's Encrypt (https://letsencrypt.org), to verify ownership of your domain name and generate a HTTPS certificate. This happens automatically when the server starts up, and will renew the certificate automatically when the expiration date is near. This only works with Kestrel, which is the default server configuration for ASP.NET Core projects. Other servers, such as IIS and nginx, are not supported. |
|
LagoVista.Net.LetsEncrypt
Provides Middleware and services to request and store certificates from the Let's Encrypt service for ASP.NET Core applications |
|
TecWare.DES.Module.ACME
ACME wrapper for the data exchange server. |
|
ZC.Middleware.DefaultAPI
Package Description |
GitHub repositories (6)
Showing the top 5 popular GitHub repositories that depend on Certes:
Repository | Stars |
---|---|
natemcmaster/LettuceEncrypt
Free, automatic HTTPS certificate generation for ASP.NET Core web apps
|
|
sjkp/letsencrypt-siteextension
Azure Web App Site Extension for easy installation and configuration of Let's Encrypt issued SSL certifcates for custom domain names.
|
|
Maarten88/rrod
Exploring a new web architecture with React, Redux, Orleans and Dotnet Core
|
|
ffMathy/FluffySpoon.AspNet.EncryptWeMust
|
|
ark-mod/ArkBot
ARK Survival Evolved application that monitors and extracts data from local ARK servers and exposes this data through a Web App, Web API and Discord Bot. Provides important functions to players: dino listings, food-status, breeding info, statistics; and server admins: rcon-commands, server managing etc.
|
Version | Downloads | Last updated |
---|---|---|
3.0.4 | 1,455 | 1/4/2023 |
3.0.3 | 94,227 | 10/4/2021 |
3.0.0 | 38,269 | 7/18/2021 |
2.3.4 | 217,646 | 3/27/2020 |
2.3.3 | 275,771 | 12/17/2018 |
2.3.2 | 53,105 | 10/20/2018 |
2.3.1 | 1,216 | 10/16/2018 |
2.3.0 | 17,838 | 6/15/2018 |
2.2.2 | 1,747 | 5/31/2018 |
2.2.1 | 1,744 | 5/15/2018 |
2.2.0 | 2,515 | 5/5/2018 |
2.1.0 | 1,554 | 4/28/2018 |
2.0.1 | 2,330 | 3/17/2018 |
2.0.0 | 1,582 | 3/13/2018 |
1.1.4 | 2,277 | 3/4/2018 |
1.1.3 | 7,535 | 11/23/2017 |
1.1.2 | 3,284 | 9/28/2017 |
1.1.0 | 3,130 | 8/17/2017 |
1.0.7 | 8,241 | 7/20/2017 |
1.0.6.202 | 2,713 | 4/4/2017 |
1.0.5.191 | 1,516 | 3/29/2017 |
1.0.4.178 | 1,474 | 3/29/2017 |
1.0.3.139 | 1,494 | 12/22/2016 |
1.0.2.108 | 1,664 | 7/13/2016 |
1.0.1.64 | 1,587 | 7/6/2016 |
1.0.0.55 | 1,674 | 7/6/2016 |