Certificate Provisioning Server

Automatic TLS certificate provisioning for sndctl devices. Zero configuration HTTPS for every device.

Overview

This server provisions TLS certificates for sndctl devices, enabling HTTPS without requiring customers to configure anything. Each device contacts this server on first boot to receive a valid, publicly-trusted certificate.

Zero Config HTTPS

Devices get valid certificates automatically on first boot

Auto Renewal

Certificates are automatically renewed before expiry

Device Management

Pre-provision and manage devices through the admin portal

How It Works

1

Pre-Provision Device

Administrators pre-provision devices in the system through the admin portal. Each device receives a unique ID and secret that will be embedded in the device firmware.

2

Device Registration

On first boot, the device calls POST /api/register with its device ID and secret. The server validates credentials and initiates certificate provisioning.

3

ACME Certificate Issuance

The server uses the ACME protocol with DNS-01 challenge to obtain a valid TLS certificate from Let's Encrypt. The certificate is issued for the device's unique hostname (e.g., abc123.sonoshub.io).

4

Certificate Delivery

The device receives its hostname, certificate, and private key. It configures its web server (Caddy) to serve HTTPS with the provisioned certificate.

5

Automatic Renewal

Before certificates expire, devices call POST /api/renew to obtain new certificates. The server handles the renewal process automatically.

Device API

POST /api/register

Register a device and obtain its initial TLS certificate.

Request Headers

X-Device-Secret: <device-secret>

Request Body

{ "deviceId": "abc123def456" }
POST /api/renew

Renew an existing device's TLS certificate before expiry.

Request Headers

X-Device-Secret: <device-secret>

Request Body

{ "deviceId": "abc123def456", "hostname": "abc123def456.sonoshub.io" }
GET /api/health

Health check endpoint to verify the server is running.