LettuceEncrypt.Dns.Ali 1.0.0

dotnet add package LettuceEncrypt.Dns.Ali --version 1.0.0
NuGet\Install-Package LettuceEncrypt.Dns.Ali -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LettuceEncrypt.Dns.Ali" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LettuceEncrypt.Dns.Ali --version 1.0.0
#r "nuget: LettuceEncrypt.Dns.Ali, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install LettuceEncrypt.Dns.Ali as a Cake Addin
#addin nuget:?package=LettuceEncrypt.Dns.Ali&version=1.0.0

// Install LettuceEncrypt.Dns.Ali as a Cake Tool
#tool nuget:?package=LettuceEncrypt.Dns.Ali&version=1.0.0

<h1> <img src="./logo.png" width="84" height="84"/> LettuceEncrypt.Dns.Ali </h1>

Build Status NuGet NuGet Downloads

基于LettuceEncrypt,使用阿里云域名DNS验证,为 ASP.NET Core Web 应用程序,自动生成HTTPS通配符域名证书,并且在到期前,自动续签。

启用后,您的web服务器将在启动过程中自动使用DNS验证,并生成HTTPS证书。

然后,它将Kestrel配置为此证书用于所有HTTPS流量。

用法

使用NuGet([请参阅此处的详细信息][nuget-url])将此包安装到您的项目中。

API的主要用法是调用 IServiceCollection.AddAliDnsChallengeProvider

using Microsoft.Extensions.DependencyInjection;
using LettuceEncrypt;
using LettuceEncrypt.Dns.Ali;

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddLettuceEncrypt();
        services.AddAliDnsChallengeProvider();
    }
}

相关参数配置,通常通过appsettings.json文件进行设置,也可以在AddAliDnsChallengeProvider方法的参数中指定配置项值。

// appsettings.json
{
    "LettuceEncrypt": {
        // 将其设置为自动接受证书颁发机构的服务条款。
        // 如果您没有在配置中设置此项,则每当应用程序启动时都需要按“y”
        "AcceptTermsOfService": true,
        
        // 指定使用DNS验证
        "AllowedChallengeTypes": "Dns01",
        
        // 指定到期前几天自动续签,TimeSpan类型格式
        "RenewDaysInAdvance": "3.00:00:00",

        // 您必须至少指定一个域名
        "DomainNames": [ "example.com", "www.example.com" ],

        // 您必须指定一个电子邮件地址才能向证书颁发机构注册
        "EmailAddress": "it-admin@example.com"
    },
    // 阿里云接口访问凭证
    "AliDns": {

        "AccessKeyId": "",

        "AccessKeySecret": "",

        "DomainName": "example.com"
    }
}
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 132 1/12/2024

首次发布!使用阿里云域名DNS验证,生成SSL泛域名解析证书