AutoHttps.Redis
1.2.0
dotnet add package AutoHttps.Redis --version 1.2.0
NuGet\Install-Package AutoHttps.Redis -Version 1.2.0
<PackageReference Include="AutoHttps.Redis" Version="1.2.0" />
<PackageVersion Include="AutoHttps.Redis" Version="1.2.0" />
<PackageReference Include="AutoHttps.Redis" />
paket add AutoHttps.Redis --version 1.2.0
#r "nuget: AutoHttps.Redis, 1.2.0"
#:package AutoHttps.Redis@1.2.0
#addin nuget:?package=AutoHttps.Redis&version=1.2.0
#tool nuget:?package=AutoHttps.Redis&version=1.2.0
AutoHttps.Redis
Redis certificate, account key and challenge stores for
AutoHttps. Several instances share their certificates,
their ACME registration and their pending http-01 challenge answers through Redis rather than a
shared filesystem.
dotnet add package AutoHttps.Redis
Use
builder.Services.AddAutoHttps(options =>
{
options.DomainNames.Add("example.com");
options.EmailAddress = "admin@example.com";
options.AcceptTermsOfService = true;
})
.UseRedis(builder.Configuration.GetConnectionString("Redis")!);
This replaces the certificate store, the account key store, the http-01 challenge store and the
lock that stops instances ordering at once. Certificates are written as a hash under
autohttps:cert:<name>, the account key under autohttps:account:<name>, a pending challenge answer
under autohttps:challenge:<token>, and the lock under autohttps:lock:<name>. Change the prefix if
you share the Redis with other things:
.UseRedis("localhost:6379", options => options.KeyPrefix = "myapp:autohttps:");
If your application already registers an IConnectionMultiplexer, that one is used and the connection
string here is ignored.
The application starts even when Redis cannot be reached: unless the connection string sets
abortConnect itself, the connection is retried in the background, and AutoHttps treats a store it
cannot reach as a failed attempt and tries again.
Coordinating instances
Instances sharing a certificate also share its renewal time, so without a shared lock they would all
order at the same moment. The lock is a key set only if absent, with a lease the holder renews while
its order runs, so an instance that dies holding it keeps the others waiting for one lease at most
(LockLease, a minute by default). To use a lock of your own instead, call UseDistributedLock<T>()
after UseRedis.
Sharing the challenge store is what lets replicas behind a single DNS name pass an http-01
validation. The authority's request lands on whichever replica the load balancer picks, which is not
necessarily the one that ordered, and any of them can then answer it from Redis. Without that, a
request reaching another replica gets a 404 and the authorization fails. If you want Redis for
certificates but not for challenges, register the challenge store yourself with
UseHttp01ChallengeStore<T>() after UseRedis.
Options
| Option | Default | What it does |
|---|---|---|
Configuration |
(from the argument) | StackExchange.Redis connection string. |
KeyPrefix |
autohttps: |
Prefix for every key written. |
ChallengeTtl |
15 minutes | How long a published challenge answer survives if an order is interrupted before removing it. Zero or less keeps it until removed. |
LockLease |
1 minute | How long the lock survives without renewal, which bounds how long a crashed holder blocks the others. Renewed every third of this while held. |
| Product | Versions 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- AutoHttps (>= 1.8.0)
- StackExchange.Redis (>= 2.8.16)
-
net8.0
- AutoHttps (>= 1.8.0)
- StackExchange.Redis (>= 2.8.16)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.