Skip to content
  • English Deutsch

benjamin-abt.com

Performance is a feature | Cloud - AI - Azure - .NET - Sustainability

  • Home
  • Blog
  • Portfolio
    • Overview
    • Workshops & Training
    • Publications
  • Contact
  • Home
  • Blog

Create a Custom Root Certificate Authority for Self-Signed Certificates

Create a Custom Root Certificate Authority for Self-Signed Certificates
October 13, 2025 7 min read BEN ABT
Security Certificates SSL TLS HTTPS Smart Home OpenSSL

When running multiple services in a local network-whether for smart home automation, home labs or development environments-HTTPS encryption becomes essential. Instead of accepting browser warnings for every self-signed certificate, creating your own Root Certificate Authority (Root CA) provides a clean, professional solution.

What is a Root Certificate Authority?

A Root Certificate Authority is the top-level entity in a Public Key Infrastructure (PKI) that issues and signs digital certificates. When a Root CA certificate is installed as trusted on a device, all certificates signed by that CA are automatically trusted without warnings.

In the public internet, organizations like DigiCert, Let’s Encrypt and GlobalSign operate as Root CAs. Their root certificates come pre-installed in browsers and operating systems worldwide. For a private network, you can create your own Root CA to achieve the same trust model-but only within devices you control.

The certificate chain works like this:

  1. Root CA signs server certificates
  2. Server presents its certificate to clients (browsers, apps)
  3. Client verifies the signature using the trusted Root CA
  4. If valid, connection is established with full HTTPS encryption

Why Create Your Own Root CA?

One-Time Trust Setup: Install the Root CA certificate once on each device and all future certificates you issue are automatically trusted-no more “NET::ERR_CERT_AUTHORITY_INVALID” warnings.

Custom Local Domains: Use meaningful domain names like homeassistant.abt, nas.abt or gitlab.lab instead of IP addresses.

Smart Home & IoT Requirements: Many smart home platforms and IoT devices require HTTPS for webhooks, APIs and secure communication.

Development & Testing: Test HTTPS-only features (service workers, secure contexts, WebRTC) in local environments without complicated workarounds.

Full Control: Manage certificate lifecycle, expiration and revocation on your own terms.

No External Dependencies: No reliance on public CAs or internet connectivity for certificate issuance.

My Use Case

I run multiple services in my local network using the .abt top-level domain:

  • Home Assistant (homeassistant.abt) – Smart home automation platform
  • NAS (nas.abt) – Network storage with web interface
  • Bitwarden (vault.abt) – Password manager
  • Raspberry Pi projects (*.pi.abt) – Various IoT experiments
  • Docker services – Self-hosted applications with web UIs
  • Development servers – Local testing with HTTPS requirements
  • IoT Devices (*.garden.abt) - Various Internet of Things devices requiring secure communication

All these services must be accessible from Windows PCs, Linux machines, macOS laptops, iPhones and Android tablets with full HTTPS support and no certificate warnings.

Creating the Root CA

Before starting, ensure you have:

  • OpenSSL installed on your system
    • Windows: choco install openssl (via Chocolatey)
    • macOS: brew install openssl (via Homebrew)
    • Linux: Usually pre-installed or apt install openssl / dnf install openssl
  • Administrator/root access to install certificates on devices
  • A secure location to store the CA private key (this is critical!)

Step 1: Create the Directory Structure

First, create a dedicated directory for your CA files:

PowerShell
New-Item -ItemType Directory -Path ".\abt-ca" -Force

Step 2: Create the OpenSSL Configuration File

Create a file abt-ca/abt-ca.cnf with the following content. This configuration defines the Root CA properties:

INI
 1[ req ]
 2default_bits = 4096
 3prompt = no
 4default_md = sha256
 5x509_extensions = v3_ca
 6distinguished_name = dn
 7
 8[ dn ]
 9C  = DE
10O  = ABT
11CN = ABT Private Root CA
12
13[ v3_ca ]
14subjectKeyIdentifier = hash
15authorityKeyIdentifier = keyid:always
16basicConstraints = critical, CA:true
17keyUsage = critical, keyCertSign, cRLSign

Configuration breakdown:

  • default_bits = 4096: Strong 4096-bit RSA key
  • default_md = sha256: SHA-256 hashing algorithm
  • x509_extensions = v3_ca: Apply CA-specific extensions
  • basicConstraints = critical, CA:true: Mark as a Certificate Authority
  • keyUsage = critical, keyCertSign, cRLSign: Allow certificate signing and CRL signing

Distinguished Name fields:

  • C: Country code (DE for Germany, US for United States, etc.)
  • O: Organization name (your name, network name, etc.)
  • CN: Common Name-what users see when viewing the certificate

Step 3: Generate the Root CA Private Key

Create the private key for your Root CA. This is the most sensitive file in your entire PKI-protect it accordingly:

PowerShell
openssl genrsa -out abt-ca/abt-ca.key 4096

This generates a 4096-bit RSA private key without a passphrase. If you want additional security (recommended for production-like environments), add -aes256 for encryption:

PowerShell
openssl genrsa -aes256 -out abt-ca/abt-ca.key 4096

You’ll be prompted for a passphrase every time you use the key to sign certificates.

Step 4: Create the Root CA Certificate

Now generate the self-signed Root CA certificate using the private key and configuration file:

PowerShell
openssl req -x509 -new -key abt-ca/abt-ca.key -sha256 -days 3650 -out abt-ca/abt-ca.pem -config abt-ca/abt-ca.cnf

Command breakdown:

  • -x509: Create a self-signed certificate
  • -new: Generate a new certificate request
  • -key abt-ca/abt-ca.key: Use the private key from Step 3
  • -sha256: Use SHA-256 signature algorithm
  • -days 3650: Certificate valid for 10 years (adjust as needed)
  • -out abt-ca/abt-ca.pem: Output certificate in PEM format
  • -config abt-ca/abt-ca.cnf: Use the configuration file from Step 2

Step 5: Verify the Root CA Certificate

Confirm the certificate was created correctly and has proper CA attributes:

PowerShell
openssl x509 -in "abt-ca/abt-ca.pem" -noout -text | Select-String -Pattern "Basic Constraints" -Context 0,3

Expected output:

1X509v3 Basic Constraints: critical
2    CA:TRUE
3X509v3 Key Usage: critical
4    Certificate Sign, CRL Sign

If you see CA:TRUE and the key usage includes Certificate Sign, CRL Sign, your Root CA is correctly configured.

You can also view the full certificate details:

PowerShell
openssl x509 -in abt-ca/abt-ca.pem -noout -text

Step 6: Create DER Format (for Some Devices)

Some platforms (especially mobile devices) prefer DER format instead of PEM. Create a DER version of your Root CA certificate:

PowerShell
openssl x509 -in .\abt-ca\abt-ca.pem -outform der -out .\abt-ca\abt-ca.der

You now have:

  • abt-ca.key – Private key (keep secure!)
  • abt-ca.pem – Root CA certificate (PEM format)
  • abt-ca.der – Root CA certificate (DER format)
  • abt-ca.cnf – OpenSSL configuration

Installing the Root CA on Devices

For certificates to be trusted, install the Root CA certificate on all your devices. Use abt-ca.pem for most systems, abt-ca.der for mobile devices.

Windows

  1. Double-click abt-ca.pem (or abt-ca.der)
  2. Click “Install Certificate”
  3. Select “Local Machine” (requires Administrator)
  4. Choose “Place all certificates in the following store”
  5. Click “Browse” and select “Trusted Root Certification Authorities”
  6. Complete the wizard

iOS/iPadOS

  1. Transfer abt-ca.der to your device (email, AirDrop or host on a web server)
  2. Open the .der file-you’ll see “Profile Downloaded”
  3. Go to Settings → General → VPN & Device Management
  4. Under “Downloaded Profile”, tap “ABT Private Root CA”
  5. Tap “Install” and enter your passcode
  6. Tap “Install” again to confirm
  7. Go to Settings → General → About → Certificate Trust Settings
  8. Enable full trust for “ABT Private Root CA”

Double check, if the custom CA is enabled! Otherwise you will still get warnings.

Security Considerations

Protect the Private Key: The Root CA private key (abt-ca.key) is the most critical file. Anyone with access can issue trusted certificates for any domain. Store it encrypted, offline and with strict access controls.

Limited Distribution: Only install the Root CA on devices you own and control. Never distribute it publicly or to untrusted parties.

Scope of Trust: This Root CA should only be used for your private network. Don’t use it to sign certificates for public internet domains.

Backup Strategy: Keep encrypted backups of your CA files in multiple secure locations (password manager, encrypted USB drive, secure cloud storage).

Certificate Expiration: Monitor server certificate expiration dates. Set reminders to renew before expiry.

Key Length: Use 4096-bit keys for the Root CA, 2048-bit minimum for server certificates.

Revocation: In production environments, implement Certificate Revocation Lists (CRL) or OCSP. For home use, manually replacing compromised certificates is usually sufficient.

Common Pitfalls

“This site is not secure” – Root CA not installed on the device or certificate Common Name/SAN doesn’t match the URL.

DNS doesn’t resolve – Certificate is valid, but the domain doesn’t resolve. Configure local DNS (router, Pi-hole, /etc/hosts) to point .abt domains to correct IPs.

Mixed content warnings – HTTPS page loading HTTP resources. Ensure all assets use HTTPS or relative URLs.

Hostname mismatch – Accessing https://192.168.1.100 won’t work if the certificate is for homeassistant.abt. Use the domain name or add the IP to Subject Alternative Name.

Certificate expired – Server certificates expire before the Root CA. Keep track of expiration dates.

Mobile apps don’t trust the CA – Android 7+ and iOS restrict user-installed CAs for some apps. Use system-level installation methods or accept limitations.

Lessons Learned

  • Separate Root CA and server operations: Keep the Root CA key offline. Only bring it online when signing new certificates.
  • Document everything: Maintain a spreadsheet or certificate management database with issuance dates, domains and expiration dates.
  • Use Subject Alternative Names (SAN): Always include SAN entries, even for single-domain certificates. Some browsers require it.
  • Plan for renewal: Server certificates have shorter lifespans. Automate renewal reminders or use scripts for bulk reissuance.
  • Reverse proxies simplify management: Use nginx or Traefik as a reverse proxy for multiple services. Manage HTTPS in one place instead of configuring every service individually.
  • Test on all platforms: Verify certificate trust on Windows, macOS, Linux, iOS and Android before relying on it.

Good luck with your private certificate infrastructure!

Related articles

Create Self-Signed HTTPS Certificates with a Custom Root CA

Oct 15, 2025 - 7 min read

Create Self-Signed HTTPS Certificates with a Custom Root CA

Once you’ve established your own Root Certificate Authority, the next step is issuing server certificates for your local services. …

Self-Hosting Vaultwarden (Bitwarden) with Docker on Synology NAS

Oct 22, 2025 - 19 min read

Self-Hosting Vaultwarden (Bitwarden) with Docker on Synology NAS

You can find the German version of this guide here: Vaultwarden auf Synology mit Docker selbst hosten Password manager services have become …

Vaultwarden (Bitwarden) mit Docker auf Synology NAS selbst hosten

Oct 22, 2025 - 18 min read

Vaultwarden (Bitwarden) mit Docker auf Synology NAS selbst hosten

You can find the English version of this guide here: Self-Hosting Vaultwarden (Bitwarden) on Synology NAS with Docker …


BEN ABT

BEN ABT

Ben is Chief Engineering Officer and Principal Software Engineer at Medialesson.de, with a strong focus on .NET and Microsoft Azure. In his professional role, he designs and builds highly scalable platforms for hybrid and cloud-based scenarios. He also advises companies and C-levels on migrating to the sovereign cloud.

He runs myCSharp.de, the largest and most active German-speaking C# community forum, actively contributes to both his own and external open-source projects and regularly shares his knowledge through his blog, at community events, conferences and as a writer for technical magazines.

Let's Work Together

Looking for an experienced Platform Architect or Engineer for your next project? Whether it's cloud migration, platform modernization or building new solutions from scratch - I'm here to help you succeed.

New Platforms

Modernization

Training & Consulting

Contact Me
X Facebook LinkedIn WhatsApp
Back Next Blog Post

Open for work!

Contact Me
BEN ABT BEN ABT Software Engineer · Microsoft MVP Passionate about .NET, Azure, performance optimization and sustainable software engineering.

Medialesson GmbH Logo

Microsoft MVP Logo

Recent posts

View all
Stop Using nginx as Your Default Static File Server in Docker

Stop Using nginx as Your Default Static File Server in …

Oct 24, 2026
Containerizing .NET in 2026 Without a Dockerfile

Containerizing .NET in 2026 Without a Dockerfile

Oct 20, 2026
Problem Details in ASP.NET Core and .NET 11

Problem Details in ASP.NET Core and .NET 11

Oct 5, 2026
Resilience in .NET with Microsoft.Extensions.Resilience

Resilience in .NET with Microsoft.Extensions.Resilience

Sep 21, 2026
What Matters in ASP.NET Core 11

What Matters in ASP.NET Core 11

Sep 14, 2026

Tags

.NET (192) Csharp (96) ASP.NET Core (48) Azure (41) DevOps (17) Docker (14) Microsoft (14) EF Core (11) Microsoft MVP (11) AI (10) GitHub (10) GitHub Copilot (10) ASP.NET (9) Security (9) Synology (9) Architecture (8) Raspberry (8) Azure Functions (7) Cloudflare (7) Bicep (6)
benjamin-abt.com

About BEN

Benjamin Abt is a Software Engineer, Platform Architect and Microsoft MVP specializing in .NET, Azure, cloud architecture, performance optimization and sustainable software development.

Connect

  • Follow me on GitHub
  • Follow me on LinkedIn
  • Follow me on Mastodon
  • Microsoft MVP profile
  • Follow SchwabenCode on GitHub
  • Follow me on X

Quick Links

  • Portfolio
  • Blog
  • Workshops & Training
  • Publications
  • Get in Touch
  • Sitemap
Open for Work

© Copyright Benjamin Abt & SchwabenCode | 2011 - 2026

Content licensed under CC BY 4.0 unless otherwise noted.

  • Impressum
  • Privacy
  • Contact