Urgent.News

What's breaking now, across thousands of outlets.

Tech

AutoHttps: automatic HTTPS for ASP.NET Core with no NuGet dependencies

I have been building AutoHttps, a small library that gets and renews TLS certificates for an ASP.NET Core app on its own. You add the package, name your domains, and the app obtains a certificate from Let's Encrypt (or any ACME authority) and keeps it renewed. Kestrel serves it. There is nothing to run alongside your process, and no NuGet dependencies come with it. Setup Three settings:…

AutoHttps is a fresh library designed to automatically obtain and maintain TLS certificates for ASP.NET Core applications. It eliminates the need for additional NuGet dependencies or service processes, as it integrates directly into the Kestrel web server. The setup involves three simple configuration settings: specifying the domain names, providing an email address, and accepting the ACME service terms.

AutoHttps acts as a proxy to Kestrel, handling the http-01 challenge from the application's request pipeline, storing the certificate on disk, and renewing it in the background. During this initial phase, it serves a self-signed placeholder to ensure a smooth certificate warning rather than a dropped handshake. The motivation behind creating AutoHttps arose from Let's Encrypt becoming archived in late 2023 and issuing short-lived six-day certificates.

This change necessitated a more adaptable renewal schedule. The library covers both http-01 and dns-01 challenges, including wildcard domains through dns-01, and supports renewal according to the ACME Renewal Information (RFC 9773). It adapts to various certificate lifetimes, including the shorter durations offered by Let's Encrypt.

AutoHttps supports multiple certificate authorities, including Let's Encrypt, ZeroSSL, Google Trust Services, and Buypass, with support for external account binding. Pluggable certificate and account-key storage, a lock for multi-instance operations, and a DNS provider interface for dns-01 challenges are also included. The library targets .NET 8.0 and .NET 10.0, and currently, it is being tested against Let's Encrypt's staging endpoint due to production rate limits.

The extensive test suite runs against Let's Encrypt's Pebble test server. Feedback is encouraged as the library is still new, so any issues or incompatibilities should be reported rather than going unnoticed.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at dev.to →

More in Tech

More from Monday 24 August →