Home Assistant 2026.12 · Home Assistant Link

Only your own devices get in: client certificates (mTLS) for Home Assistant Link

From Home Assistant 2026.12, you can require a certificate for remote access through Home Assistant Link (Nabu Casa).

  • Only devices with a unique certificate get to see the login page.
  • Everyone else, including the bots that scan the internet all day, is blocked.
  • Built into Home Assistant: no VPN, Tailscale, Cloudflare Tunnel, or reverse proxy needed.
  • You make the certificates on a Mac or Linux computer, then install them on your iPhone, iPad, Mac, or Linux computer.
  • About 30 minutes, step by step.
  • Don't need remote access, don't use Home Assistant Link, or happy with VPN access only? Then you don't need this.

Why do this?

Your Home Assistant Link address (the Nabu Casa URL used for remote access) isn't secret. It shows up in public certificate logs, and scanners watch those logs. Anyone who finds it can (and sometimes will) access your login page.

Your password (and hopefully two-factor authentication) keeps them out. However, bots will still knock, over and over, probe the page, and sometimes try to log in. Each failed login lands as a notification.

With client certificates (mTLS), only devices you've installed one of your unique certificates on get to see the login page. No certificate, no login page: nothing to probe, no failed-login notifications, and one more (important) layer of security.

You don't need any external service for this, no Cloudflare and no reverse proxy. You make the certificates yourself, and your own Home Assistant checks them. Home Assistant Link only passes the connection through:

LOCAL NETWORK · LOCAL ADDRESSAny deviceno certificateHOME ASSISTANT LINK · REMOTE ADDRESSBot or any deviceno certificateYour devicewith certificatecertificate checkBlockedno login pageHome AssistantLogin pageLogin page

What you'll make

You'll be your own CA (certificate authority): the one who signs certificates. That gives you three kinds of files, and each goes to a different place:

File What it is Where it goes
ca.key Your CA's secret key. It signs the device certificates. Stays on the computer where you made it. Keep a copy somewhere safe.
ca.crt Your CA's public certificate Home Assistant
phone.p12, laptop.p12, … One per device: its certificate and key, protected with a strong password On device. Keep its password somewhere safe.

Think of a king's signet ring. Only the king has the ring (ca.key). Every letter he seals (each device's .p12) carries his wax seal, and nobody can forge it without the ring. The guard at the gate doesn't need the ring, only a reference of the seal (ca.crt) to check each letter's wax seal against. Home Assistant is the guard with the reference seal.

Signet ringca.keystays on your computersealssealscopy for the guardSealed letterphone.p12 · goes on the phoneSealed letterlaptop.p12 · goes on the laptopReference sealca.crt · goes to Home Assistant
Right sealphone.p12 · your deviceWrong sealfrom someone else's CANo sealno certificate, like a botGets inlogin pageBlockedno login pageBlockedno login pageGuard: Home Assistantchecks each seal against the reference seal ca.crt

1Make your CA (the signet ring)

Install and check OpenSSL:

Your system:

Check that Homebrew works:

Terminal
brew --version

It should show a version number.

It says "command not found"

Terminal doesn't know about Homebrew yet. Run these two lines, then try brew --version again:

Terminal
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

Install OpenSSL 3:

Terminal
brew install openssl

Check which one Terminal uses:

Terminal
openssl version

It should say OpenSSL 3 or newer.

It says "LibreSSL"

That's an older toolkit built into macOS, and this guide needs OpenSSL 3. Run this in the same window, then check again. It only lasts for that window, so run it again if you open a new one:

Terminal
export PATH="$(brew --prefix openssl)/bin:$PATH"

Check that OpenSSL is installed:

Terminal
openssl version

It should say OpenSSL 3 or newer.

It says "command not found"

Install it:

  • Ubuntu, Debian: sudo apt install openssl
  • Fedora: sudo dnf install openssl

Make a folder in your home folder and create the CA there:

Terminal
cd ~ && mkdir -p ha-certs && cd ha-certs

openssl ecparam -name prime256v1 -genkey -noout -out ca.key

openssl req -x509 -new -key ca.key -days 3650 \
  -subj "/CN=My Home Assistant CA" \
  -addext "basicConstraints=critical,CA:TRUE" \
  -addext "keyUsage=critical,keyCertSign,cRLSign" \
  -out ca.crt

What this did:

  • Your signet ring: the first command made the secret key ca.key.

  • The reference seal for the guard: the second command made the public certificate ca.crt, valid for 10 years.

Both files are now in the ha-certs folder in your home folder.

To see them:

Your system:
Terminal
open ~/ha-certs

This opens the folder in Finder.

Terminal
xdg-open ~/ha-certs

This opens the folder in your file manager.

2Make a certificate for each device (the sealed letters)

Follow these steps for each device: phone, laptop, tablet, etc.

Name the device (change the two purple values for each device):

Terminal
cd ~/ha-certs
NAME="phone"
LABEL="My Phone"

NAME becomes the file name, here phone.p12.
LABEL is what you see when a browser asks which certificate to use.

Make the certificate in the same Terminal window (it uses NAME and LABEL from above):

Terminal
openssl ecparam -name prime256v1 -genkey -noout -out "$NAME.key"

openssl req -new -key "$NAME.key" -subj "/CN=$LABEL" -out "$NAME.csr"

openssl x509 -req -in "$NAME.csr" -CA ca.crt -CAkey ca.key -days 730 \
  -extfile <(printf "basicConstraints=CA:FALSE\nkeyUsage=critical,digitalSignature\nextendedKeyUsage=clientAuth") \
  -out "$NAME.crt"

openssl pkcs12 -export -in "$NAME.crt" -inkey "$NAME.key" -name "$LABEL" \
  -out "$NAME.p12"

The last command asks for that password twice. Each time, paste it from your password manager and press Enter. The password stays invisible while you paste, which is normal.

What this did:

  • A sealed letter: phone.p12, this device's certificate and key in one password-protected file, valid for 2 years. It's the only file the device needs.

For the next device, change NAME and LABEL (for example "laptop" and "My Laptop") and run both blocks again.

What the options mean
  • -days 730: valid for 2 years.
  • CA:FALSE: this certificate can't sign other certificates.
  • digitalSignature, clientAuth: it can only be used to log in, not as a website's certificate.
  • -name "$LABEL": the name shown in Keychain and in certificate pickers.
  • The .p12 uses OpenSSL 3's standard encryption (AES-256). iPhone or iPad on iOS 17 or older, or a Mac on macOS 14 or older? Add -certpbe PBE-SHA1-3DES -keypbe PBE-SHA1-3DES -macalg sha1 to the last command. Those versions only read that older format and otherwise report a wrong password even when it's right.

3Copy ca.crt to Home Assistant (the reference seal)

You do this in the browser, in Home Assistant itself.

Install the File editor (if you don't have it yet):
Settings → Apps → Install app (bottom right) → search for "File editor" → Install. Then click Start and turn on Show in sidebar.

Create a folder:
Open File editor in the sidebar and click the folder icon (top left). In the panel that opens, click New Folder (the folder with a plus) and name it mtls.

Upload ca.crt:
Click the mtls folder to open it. Then click Upload File (the arrow pointing up), go to the ha-certs folder in your home folder and select ca.crt.

What this did:

  • The reference seal is now with the guard, at /config/mtls/ca.crt.

You'll need that path in step 4.

4Switch it on

Open the settings:
Settings → System → Network. Scroll down to HTTP server and open SSL/TLS.

Settings›System›Network›HTTP server›SSL/TLS
SSL/TLS
Require client certificates for remote access
Require client certificates on remote access through Home Assistant Link. Needs an SSL peer certificate.
2
Save
Illustration. Save and confirm after each of the two changes.

Add the reference seal:
In SSL peer certificate path, enter /config/mtls/ca.crt and click Save. Home Assistant restarts (about a minute) and then asks you to confirm the new setting. Confirm it.

Turn on the check:
Turn on Require client certificates for remote access and click Save. Again, wait for the restart and confirm.

After each save, Home Assistant asks you to confirm the new setting within 5 minutes. It's a safety net in case something goes wrong.

You saveRestartabout 1 minuteConfirm?within 5 minutesNew setting staysyou confirmedOld setting comes backnot confirmed in time

5Install the certificate on your devices

Each device gets its own .p12 from step 2. The Home Assistant app and the browser on the same device each need their own import.

Your system:

Home Assistant app on iPhone or iPad:

  • macOS: Right-click phone.p12 → Compress, then AirDrop the zip to the phone.
  • Linux: Run cd ~/ha-certs && zip phone.zip phone.p12 (no zip? sudo apt install zip), then e-mail the zip to yourself or put it in a cloud drive.
  • On the phone, save the zip in Files and tap it to unzip. (The zip only makes sure the file lands in Files; a bare .p12 opens as a profile instead.)
  • In the app: Settings → Companion app → your server → Client Certificate → Import.
  • Pick phone.p12 and paste its password.
‹ Companion app
My Home
NameMy Home
Internal URL›
External URL›
Client Certificate
Pick the .p12 from Files and type its password.
Home Assistant app illustration.

Apple Watch:

  • Nothing to import. The watch app goes through the iPhone app.
  • Complications and widgets may stop updating away from home. Apple doesn't allow client certificates in background updates.

Safari on iPhone or iPad:

  • macOS: AirDrop phone.p12 to the phone (this time not zipped).
  • Linux: E-mail phone.p12 to yourself and open it in Mail on the phone.
  • Open Settings → Profile Downloaded → Install. "Not Signed" is normal for your own certificate.
  • Enter your phone's passcode, then the .p12 password.
CancelInstall
Install Profile
My Phone
Signed byNot Signed
ContainsIdentity Certificate
"Not Signed" is normal for a certificate you made yourself.
iPhone Settings illustration (for Safari).

Home Assistant app on Mac:

  • In the app: Settings → Companion app → your server → Client Certificate → Import.
  • Pick laptop.p12 in the ha-certs folder and paste its password.

Browsers on Mac (Safari, Chrome, Firefox):

  • Double-click laptop.p12. Keychain Access opens. If it asks for a keychain, keep login and click Add. Then paste its password and click OK.
  • Open your remote address. The browser shows a list of certificates: pick My Laptop. In Firefox, also tick Remember this decision.
  • macOS then asks for your Mac password. Type it and click Always Allow (not Allow). It won't ask again for that browser.
  • Safari keeps asking? Open Keychain Access → login → My Certificates → select My Laptop → File → New Identity Preference → enter your remote address → Add.
  • Firefox list empty? Settings → Privacy & Security → Certificates → View Certificates → Your Certificates → Import.

Browsers on Linux (Firefox, Chrome):

  • Firefox: Settings → Privacy & Security → Certificates → View Certificates → Your Certificates → Import, pick laptop.p12, paste its password.
  • Chrome: Chrome's certificate screen changes between versions, so use Terminal: cd ~/ha-certs && pk12util -d sql:$HOME/.local/share/pki/nssdb -i laptop.p12, paste the password, and restart Chrome. If you have a ~/.pki/nssdb folder (older setups), use sql:$HOME/.pki/nssdb instead. No pk12util? sudo apt install libnss3-tools.

6Test it

Test on mobile data, not on your home Wi-Fi. At home, the app switches to your local address, where no certificate is checked.

Test What you should see
Remote address, device without certificate Error page or "connection closed". No login page.
Remote address, device with certificate The browser may ask which certificate to use. Then the normal login page.
Home Assistant app away from home Works as before, once the certificate is imported in the app.
Local address, no certificate Works as before.
https://xxxx.ui.nabu.casa
This site can't be reached
The connection was closed.
Without certificate: no login page
https://xxxx.ui.nabu.casa
Select a certificate
The site needs a certificate to identify you.
My Laptop My Home Assistant CA
CancelOK
With certificate: pick it, then the login page
Illustration. The wording differs a bit between Safari, Chrome, and Firefox.

If you see the login page without a certificate, the setting is not active. Check step 4.

Clean up

Once all your devices work:

  • Keep safe: ca.key (with a copy somewhere safe) and ca.crt. You need them for new devices and renewals.
  • Device files: delete phone.key, phone.csr, and phone.crt (and the same for your other devices). Either delete phone.p12 too, or attach it to its password entry in your password manager. Also delete the copies you sent: the zip and the .p12 in Files on the phone, and any e-mail to yourself.

Good to know

Adding a new server in the app while away from home. Older app versions showed a blank window when only the remote address needed a certificate. A fix has been merged and comes with an upcoming app update. Until then, add the server while you're at home, then import the certificate (yes, I made this mistake).

Just installed the certificate in Safari and it still fails? Safari keeps the old connection. Force-quit Safari, then try again.

Notification images and videos. Images or camera clips attached to notifications can fail to load with client certificates on iOS. Plain notifications work.

When certificates expire. The device certificates above last 2 years, the CA 10 years. Put a reminder in your calendar. To renew, repeat step 2 for each device and import the new .p12.

A lost or stolen device. You can't block a single certificate. Make a new CA (step 1), new certificates for the devices you still have (step 2), replace ca.crt on Home Assistant (step 3), restart Home Assistant (Settings → System → power icon, top right), and import the new ones. All old certificates stop working at once.

Turning it off. Switch off "Require client certificates for remote access" in step 4. Everything works as before. SSL certificate set in Home Assistant itself? Also empty SSL peer certificate path.

License

This guide is licensed under CC BY 4.0. Copy, share, and adapt as much as you like, also commercially. Just credit the source with a link to https://github.com/skarvall/ha-link-mtls-guide.