Home Assistant Link guide

Require client certificates for remote access

From Home Assistant 2026.12, you can require a client certificate for remote access through Home Assistant Link. Only devices with a certificate you created can open your remote access URL. Every other device gets a closed connection instead of the login page. This is also known as mutual TLS (mTLS).

Remote access security (opens in a new tab)

What this setting affects

For advanced users: this option is only for users who are comfortable creating and managing their own certificates. When certificates expire, you can lose all access to Home Assistant, and getting back in requires a terminal connection to the host. For most setups, a strong password and two-factor authentication give good protection on their own. For more ways to protect your system, see Securing your Home Assistant (opens in a new tab).

Your remote access URL is listed in public certificate logs (see Remote access - security aspects (opens in a new tab)). With client certificates turned on, any client without one of your certificates, including bots and scanners that find the URL, can’t reach your login page. Those clients also can’t trigger failed-login notifications.

Home Assistant Green at the top. One dotted line runs down from it and branches to a smart speaker for Alexa and Google Assistant, a laptop for your local address, and a phone for remote access. Only the phone’s branch passes through a padlock marked certificate required.
Only remote access through Home Assistant Link asks for a certificate. Your local address, Alexa and Google Assistant work as before.
  • Remote access through Home Assistant Link: requires a client certificate.
  • Amazon Alexa, Google Assistant, and other Home Assistant Link features: work as before. The setting only applies to remote access.
  • Your local address: works as before, without a certificate. If Home Assistant serves HTTPS itself (SSL certificate path is set), setting the SSL peer certificate path makes local connections require a client certificate too.

Before you turn this on

  • You manage the certificates. When a device’s certificate expires, that device can no longer connect remotely until you create a new certificate for it. When your certificate authority (CA) expires, all your device certificates stop working. Note the expiry dates and renew in time.
  • Locking out one device means replacing all certificates. If a device is lost or stolen, create a new CA and new certificates for your other devices.
  • If Home Assistant can’t load your CA file, the result depends on your setup:
    • Home Assistant doesn’t serve HTTPS itself (SSL certificate path is empty): a repair appears and remote access stays off. Fix the file, or use the repair to turn off the client certificate requirement.
    • Home Assistant serves HTTPS itself: Home Assistant blocks all connections, local and remote. To get back in, follow If you can’t access Home Assistant anymore.
  • iPhone and iPad: The Home Assistant app supports client certificates. Widgets and Apple Watch complications may not update in the background while you’re away from home.

Set it up

Step 1: Prepare a way back in

Set this up first, so you can recover if your certificates stop working.

  1. Create a full backup, and check that it’s stored as your off-site backup (opens in a new tab) with Home Assistant Link.

  2. Set up SSH access to the Home Assistant host, for example with the Terminal & SSH app (opens in a new tab).

  3. From another computer, connect to the host over SSH to check that it works.

    The app’s web terminal runs inside the Home Assistant interface. When you’re locked out of Home Assistant, only an SSH connection from another computer still works.

Step 2: Create a certificate authority and client certificates

You need three kinds of files:

  • ca.key: The private key of your CA. It signs your device certificates. Keep it on the computer where you created it, with a backup somewhere safe. Anyone with this file can create certificates that Home Assistant accepts.
  • ca.crt: The public certificate of your CA. This file goes to Home Assistant.
  • One .p12 file per device, for example phone.p12. It holds that device’s certificate and key, protected with a password.
Your computer, Home Assistant Green and a phone standing for each device, joined by dotted lines. Each has its file: ca.key stays on your computer, ca.crt goes to Home Assistant and checks the others, and phone.p12 is one per device.
The CA key signs your device certificates and stays on your computer. Home Assistant gets the CA certificate, and each device gets its own file.

The commands below use OpenSSL 3 on macOS or Linux. On Windows, run them in Windows Subsystem for Linux (WSL) (opens in a new tab). Run them on your own computer, not on the Home Assistant host, so the CA key stays off the system that trusts it. The commands create ECDSA keys, which work on Apple devices as well as Android.

  1. Create the CA, valid for 10 years:

    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
  2. Create a certificate for a device, valid for 2 years. Replace phone and My phone with a name for each device:

    cd ~/ha-certs
    printf "basicConstraints=CA:FALSE\nkeyUsage=critical,digitalSignature\nextendedKeyUsage=clientAuth\n" > client.ext
    
    openssl ecparam -name prime256v1 -genkey -noout -out phone.key
    
    openssl req -new -key phone.key -subj "/CN=My phone" -out phone.csr
    
    openssl x509 -req -in phone.csr -CA ca.crt -CAkey ca.key -CAcreateserial \
      -days 730 -extfile client.ext -out phone.crt
    
    openssl pkcs12 -export -in phone.crt -inkey phone.key -name "My phone" -out phone.p12

    The last command asks for a password for the .p12 file. Use a strong password and store it in a password manager.

    For devices on iOS 17, iPadOS 17, macOS 14, or older, add -certpbe PBE-SHA1-3DES -keypbe PBE-SHA1-3DES -macalg sha1 to the last command. Without these options, those versions can’t open the .p12 file and report a wrong password.

  3. Repeat the previous step for each device.

Step 3: Copy the CA certificate to Home Assistant

Copy ca.crt into your Home Assistant configuration folder, for example to /config/mtls/ca.crt. You can use the File editor or Samba share app for this. The File editor shows the configuration folder as /homeassistant, which is the same folder as /config.

Step 4: Turn on the client certificate requirement

Make this change from your local address, so you keep access while you test.

If Home Assistant serves HTTPS itself, first install a certificate in the browser or app you’re using, as described in Step 5. Without it, you can’t reconnect after the restart to confirm the change, and Home Assistant goes back to the previous settings.

  1. In Home Assistant, go to Settings > System > Network (opens in a new tab).

  2. Under HTTP server, expand SSL/TLS.

  3. In SSL peer certificate path, enter the path to your CA certificate, for example /config/mtls/ca.crt.

  4. Turn on Require client certificates for remote access.

  5. Select Save. Home Assistant restarts to apply the settings.

  6. After the restart, confirm the change when Home Assistant asks. If you don’t confirm in time, Home Assistant goes back to the previous settings.

Step 5: Install the certificates on your devices

Each device gets its own .p12 file. On a device, the Home Assistant app and each browser need the certificate installed separately.

  • Home Assistant app (Android, iPhone, iPad, Mac): Import the .p12 file as described in TLS client authentication (opens in a new tab).
  • Browsers: Import the .p12 file into the certificate store of the operating system or browser. When you open your remote access URL, the browser asks which certificate to use.

Step 6: Test the connection

Test from outside your home network, for example on mobile data. On your home network, the Home Assistant app uses your local address, which doesn’t check for a certificate.

  • Device with a certificate: You see the login page after choosing the certificate.
  • Device without a certificate: Opening your remote access URL shows a connection error instead of the login page.
Two phones. The one with a certificate shows the login page and a green tick. The one without a certificate shows a warning and a cross.
A device with a certificate sees the login page after choosing it. A device without one gets a connection error instead.

If a device without a certificate still reaches the login page, check that you saved the setting in Step 4.

Renewing or replacing certificates

  • A device certificate expired or is about to expire: If your CA is still valid, create a new certificate for that device, as in Step 2, and import the new .p12 file.
  • Your CA expired, or a device is lost or stolen: Create a new CA and new certificates for your devices, replace ca.crt in Home Assistant, restart Home Assistant, and import the new .p12 files. All old certificates stop working.
A ten-year timeline. Your CA is one bar across all ten years. Each device certificate lasts two years, with a marker every two years to create a new device certificate.
Device certificates last 2 years and your CA lasts 10. When the CA expires, every device certificate stops working.

Turning it off

  1. Go to Settings > System > Network (opens in a new tab) and expand SSL/TLS under HTTP server.

  2. Turn off Require client certificates for remote access and select Save.

  3. After the restart, confirm the change when Home Assistant asks.

If Home Assistant serves HTTPS itself, also clear SSL peer certificate path to stop requiring certificates on local connections.

If you can’t access Home Assistant anymore

If you can’t reach Home Assistant in the browser or app, for example because your certificates expired, remove the CA setting directly on the Home Assistant host. Home Assistant stores these HTTP settings itself, so editing configuration.yaml doesn’t change them.

Another computer joined to Home Assistant Green by a solid line marked SSH. A padlock beside Home Assistant Green is marked certificates expired.
When you’re locked out of Home Assistant, only an SSH connection from another computer still works.
  1. From another computer, connect to the Home Assistant host over SSH, as set up in Step 1.

  2. Make a backup copy of the file /config/.storage/http:

    cp /config/.storage/http /config/http.backup
  3. Open /config/.storage/http in a text editor. The file is in JSON format.

  4. Under data > stable, remove the ssl_peer_certificate line. If it was the last entry in that block, also remove the comma at the end of the line before it, so the JSON stays valid.

  5. Save the file and restart Home Assistant:

    ha core restart

After the restart, you can reach Home Assistant without a client certificate. To use client certificates again, start from Step 2 with a new CA and new device certificates.

Related topics