strict_sni_check not persisted by POST /control/tls/configure API
Prerequisites
-
[x] I have checked the Wiki and Discussions and found no answer
-
[x] I have searched other issues and found no duplicates
-
[x] I want to report a bug and not ask a question or ask for help
-
[x] I have set up AdGuard Home correctly and configured clients to use it. (Use the Discussions for help with installing and configuring clients.)
Platform (OS and CPU architecture)
Linux, ARMv7
Installation
Docker
Setup
On one machine
AdGuard Home version
v0.107.73
Action
Prerequisites
- [x] I am running the latest version
- [x] I checked the documentation and found no answer
- [x] I checked to make sure that this issue has not already been filed
- [x] I want to report a bug and not ask a question
Environment
- AdGuard Home version: v0.107.73
- Operating system: Ubuntu 22.04 (Docker container)
- CPU architecture: ARM64 (Hetzner CAX21) / x86_64 (Azure)
- Installation method: Docker
Problem Description
strict_sni_check is documented in the OpenAPI schema as a field of
TlsConfig, accepted by POST /control/tls/configure and returned by
GET /control/tls/status. However, when sent via the API, the field is
neither persisted to AdGuardHome.yaml nor reflected in the subsequent
GET /control/tls/status response.
Steps to Reproduce
1. Check current value via status API:
curl -s -u "user:pass" \
https://your-agh-host/control/tls/status | jq '.strict_sni_check'
# Returns: null
2. Send tls/configure with strict_sni_check: true:
curl -s -u "user:pass" \
-X POST https://your-agh-host/control/tls/configure \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"server_name": "doh.example.com",
"force_https": true,
"port_https": 443,
"port_dns_over_tls": 853,
"certificate_chain": "<base64>",
"private_key": "<base64>",
"strict_sni_check": true
}' | jq '.strict_sni_check'
# Returns: null
3. Verify it was not persisted:
curl -s -u "user:pass" \
https://your-agh-host/control/tls/status | jq '.strict_sni_check'
# Returns: null
grep strict_sni_check /path/to/AdGuardHome.yaml
# Returns: strict_sni_check: false
Expected result
strict_sni_check: true sent via POST /control/tls/configure should:
- Be persisted to
AdGuardHome.yaml - Take effect immediately (connections with non-matching SNI rejected)
- Be returned as
truebyGET /control/tls/status
Actual result
GET /control/tls/statusreturnsnullforstrict_sni_checkPOST /control/tls/configureaccepts the field without error (HTTP 200) but silently ignores itAdGuardHome.yamlalways showsstrict_sni_check: falseafter any API call totls/configure- The field can only be set by manually editing
AdGuardHome.yamland restarting the service
Additional information and/or screenshots
Impact
Users automating certificate renewal via the API (a common pattern for
Let's Encrypt renewals) cannot maintain strict_sni_check: true
persistently. Every API call to tls/configure silently resets it to
false, removing SNI-based connection filtering without any warning.
This is confirmed by the existing issue #1484 (filed in 2020) which
reported the same reset behaviour via the GUI. The root cause appears
unchanged — strict_sni_check is not included in the API handler's
config mapping even though it exists in the OpenAPI schema.
References
- Issue #1484 —
strict_sni_checkreset via GUI save (2020, same root cause) - OpenAPI schema
TlsConfig— field documented but not handled - Wiki: https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration
Suggested Fix
Include strict_sni_check in the POST /control/tls/configure request
handler so it is read from the payload and written to the configuration,
matching the behaviour of all other TlsConfig fields.
@iAmSaugata, hello and thanks for the report. Actually, the strict_sni_check field doesn't exist within the TlsConfig schema object or any other object in the OpenAPI specification. However, you are right that its value should persist regardless of API calls. It seems like the bug from #1484 has arisen again. We're working on the fix.
@iAmSaugata, hello again. The fix is available in the latest edge release (v0.108.0-a.1274+bb189854), could you please check that the strict_sni_check setting is not being overwritten anymore?
@iAmSaugata, hello again. We'll close the issue for now. Please feel free to reopen it if the problem reappears.
I will verify.