TlsCertificateLoader 1.1.0
See the version list below for details.
dotnet add package TlsCertificateLoader --version 1.1.0
NuGet\Install-Package TlsCertificateLoader -Version 1.1.0
<PackageReference Include="TlsCertificateLoader" Version="1.1.0" />
<PackageVersion Include="TlsCertificateLoader" Version="1.1.0" />
<PackageReference Include="TlsCertificateLoader" />
paket add TlsCertificateLoader --version 1.1.0
#r "nuget: TlsCertificateLoader, 1.1.0"
#:package TlsCertificateLoader@1.1.0
#addin nuget:?package=TlsCertificateLoader&version=1.1.0
#tool nuget:?package=TlsCertificateLoader&version=1.1.0
TlsCertificateLoader
Allows loading of TLS (HTTPS) certificates for .NET 6.0 Kestrel web applications, allowing for refreshing of certificates as well as compatibility with HTTP/3. Fully compatible with certificates obtained by Certbot.
To use:
TlsCertificateLoader.TlsCertificateLoader tlsCertificateLoader = new(fullChainPemFilePath, privateKeyPemFilePath);
options.ListenAnyIp(433, o =>
{
o.SetTlsHandshakeCallbackOptions(tlsCertificateLoader);
o.SetHttpsConnectionAdapterOptions(tlsCertificateLoader);
o.Protocols = HttpProtocols.Http1AndHttp2AndHttp3;
});
And to refresh (eg either on a Timer or watching a directory via PhysicalFileProvider):
tlsCertificateLoader.RefreshDefaultCertificates();
You may also add additional certificate collection for other hostnames (for example if you want to set up mydomain.tld as your default certificate and www.mydomain.tld as your alternate one):
tlsCertificateLoader.AddAdditionalCertificates("www.mydomain.tld", fullChainWwwPemFilePath, privateKeyWwwPemFilePath);
And to refresh additional certificate collections (eg either on a Timer or watching a directory via PhysicalFileProvider):
tlsCertificateLoader.RefreshAdditionalCertificates("www.mydomain.tld");
Credits
David Fowler for this idea.
Logo made by Freepik from www.flaticon.com.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 was computed. 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. |
-
net6.0
- Microsoft.AspNetCore.Server.Kestrel.Core (>= 2.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Added the ability to add additional certificate collections for different hostnames.