Skip to content
pubscout

shelf_letsencrypt

2.0.8, released 3 weeks ago by an unverified publisher

Let's Encrypt support and automatic HTTPS certificate management for the shelf package.

$ flutter pub add shelf_letsencrypt
Source repository

What it does

Brings Let's Encrypt automated HTTPS certificate support to the shelf web package. It handles ACME challenges, stores certificates securely with appropriate permissions, and provides tools for domain certificate renewals.

AI-written summary of version 2.0.8, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are building a Dart backend using shelf and need free automated HTTPS certificates.
  • You want built-in certificate generation, storage management, and automatic renewals.

Skip it when

  • You are not using the shelf package for your server.
  • Your deployment environment terminates SSL at a reverse proxy or load balancer rather than the application server.

Strengths

  • Automatic Let's Encrypt certificate issuing and renewal for shelf servers.
  • Supports multi-domain configurations on the same HTTPS port.
  • Includes a robust command-line tool for inspecting, requesting, and renewing certificates.

Weaknesses

  • Requires proper NAT and DNS configurations in development environments.
  • Requires root privileges on Linux to open ports 80 and 443.

Setup

Kind
FFI (native library)
Effort
Medium
Code generation
No
Direct dependencies
9

Requires domain names, email addresses, and appropriate permissions (root privileges to bind to standard ports 80 and 443 on Linux).

import 'dart:io';
import 'package:shelf/shelf.dart';
import 'package:shelf_letsencrypt/shelf_letsencrypt.dart';

void main(List<String> args) async {
  final domains = Domain.fromDomainsNamesAndEmailsArgs('www.domain.com', 'info@domain.com');
  final certificatesHandler = CertificatesHandlerIO(Directory('/var/lib/myapp/certs'));
  final letsEncrypt = LetsEncrypt(certificatesHandler, production: false);
  final pipeline = const Pipeline().addMiddleware(logRequests());
  final handler = pipeline.addHandler((request) => Response.ok('OK'));
  await letsEncrypt.startServer(handler, domains, loadAllHandledDomains: true);
}

Alternatives

Packages that do the same job and could replace shelf_letsencrypt.

Works with

Packages commonly used together with shelf_letsencrypt: ones it builds on, ones built on it, and its own family.