RCL.LetsEncrypt
1.0.0
The owner has unlisted this package.
This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package RCL.LetsEncrypt --version 1.0.0
NuGet\Install-Package RCL.LetsEncrypt -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="RCL.LetsEncrypt" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RCL.LetsEncrypt" Version="1.0.0" />
<PackageReference Include="RCL.LetsEncrypt" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RCL.LetsEncrypt --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RCL.LetsEncrypt, 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.
#:package RCL.LetsEncrypt@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RCL.LetsEncrypt&version=1.0.0
#tool nuget:?package=RCL.LetsEncrypt&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
RCL.LetsEncrypt
Free LetsEncrypt HTTPS for Azure web apps hosted with Azure DNS Zones
This library provides the following functions:
- Performs a DNS challenge for a custom domain for a web app (wild card domains are supported (*.mydomain.com))
- Verifies a domain by adding a TXT Record to an Azure DNS Zone
- Creates a .pfx certificate for the custom domain using LetsEncrypt
- Stores the .pfx file in Azure Blob Storage
You can upload the .pfx file to an Azure web app to create a SSL binding for the custom domain.
Install from NuGet
PM> Install-Package RCL.LetsEncrypt -Version 1.0.0
Sample Usage
using RCL.LetsEncrypt.Core;
using System.Threading.Tasks;
namespace ConsoleLetsEncrypt
{
class Program
{
static void Main(string[] args)
{
CreateSSLCertificate().GetAwaiter().GetResult();
}
public static async Task CreateSSLCertificate()
{
// Create an Active Directory application to access the Azure REST APIs
// Configure the authentication options from the application properties
AuthOptions authOptions = new AuthOptions
{
authTokenService = new AuthTokenService(
new ClientOptions
{
// The app id
client_id = "5467-748-85yrt-te5366e",
// The app secret
client_secret = "dkkfur775ygfhh664ger=",
// The tenant id (directory id) for the Active Directory
tenantId = "2344-ndfjhh-fry545-54jdhfbbrf"
},
new ServiceOptions
{
// The endpoint to access the auth token (replace tenantid with the actual value)
endpoint = $"https://login.microsoftonline.com/<<tenantId>>/oauth2/token",
grant_type = "client_credentials",
resource = "https://management.core.windows.net/",
}
),
// The Azure subscription id
subscriptionId = "ac0996a9-3950-4bed-8d2d-193782700832"
};
// Configure the Azure Blob Storage to store the .pfx cerftificate
BlobStorageOptions blobStorageOptions = new BlobStorageOptions
{
// Add the blob storage connection string
blobStorageService = new AzureBlobStorageService("replace-with-your-storage-connection-string"),
// Set a name to store the lets encrypt account key
acmeKeyBlobName = "acmekey.txt",
// Add the storage container name
storageContainer = "pem"
};
// Configure the Domain so that it can be verified
DomainOptions domainOptions = new DomainOptions
{
// The Resource Group that contains the DNS Zone
dnsResourceGroup = "EastUS2",
// The DNS Zone name
dnsZone = "shopeneur.com",
// The domain name for which a certificate is being created (supports wild cards eg: *.shopeneur.com)
domainName = "shopeneur.com",
// The name of the TXT record to be used for the validation
txtRecordName = "_acme-challenge"
};
// Configure the lets encrypt parameters
LEOptions lEOptions = new LEOptions
{
// The lets encrypt API endpoint, either development or production
acmeEnvironment = AcmeEnvironment.Development,
// The password to use for the certificate
certificatePassword = "rggrg6455*&",
// The email
email = "ntoifyme.mail.com",
// The certificate information
csrInfo = new Certes.CsrInfo
{
CommonName = domainOptions.domainName,
CountryName = "Trinidad",
Locality = "Cunupia",
State = "Cunupia",
Organization = "Ray Consulting Limited",
OrganizationUnit = "IT"
}
};
// Configure the options for the SSL bindings for the web app
SSLOptions sSLOptions = new SSLOptions
{
// The location of the web app
sslLocation = "East US 2",
// The Resource Group that contains the web app
sslResourceGroup = "shopeneurWeb"
};
// Create the service (acme) to carry out the lets encrypt operations
ILetsEncryptService letsEncryptService = new AcmeService(blobStorageOptions, lEOptions, domainOptions);
// Create the service (azure) in which you will install the SSL certificate
ICloudService cloudService = new AzureService(authOptions);
// Add the domain and create the certificate. The .pfx certificate for the domain will be stored in Azure storage.
AcmeOperation acmeOperation = new AcmeOperation(
authOptions,
blobStorageOptions,
lEOptions,
domainOptions,
sSLOptions,
letsEncryptService,
cloudService);
int r = await acmeOperation.AddDomainAsync();
}
}
}
How to contibute code to this project
- Open an issue describing what you want to do. Wait for approval before you invest much time.
- Fork the repo and create a branch for your changes.
- Submit a PR to master with your changes.
- Respond to PR feedback.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Certes (>= 2.3.3)
- Microsoft.Azure.Storage.Blob (>= 10.0.2)
- Microsoft.Extensions.Logging (>= 2.2.0)
- Microsoft.Extensions.Logging.Debug (>= 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.
Version | Downloads | Last Updated |
---|