From bb189854298b67d5cb734e10fac4995da11779f1 Mon Sep 17 00:00:00 2001 From: Eugene Burkov Date: Wed, 8 Apr 2026 12:12:53 +0000 Subject: [PATCH] Pull request 2619: 8327-fix-tls-settings-rewrite Updates #8327. Squashed commit of the following: commit 049839387a70db6886a3dd6806ba0351ec19621e Merge: 9dfbdf917 4dc7d9d39 Author: Eugene Burkov Date: Wed Apr 8 14:55:44 2026 +0300 Merge branch 'master' into 8327-fix-tls-settings-rewrite commit 9dfbdf917f30df1c17bce4862b19357679928450 Author: Eugene Burkov Date: Mon Apr 6 16:19:45 2026 +0300 home: fix tls config rewrite --- CHANGELOG.md | 4 ++++ internal/home/tls.go | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f6bad3f7..7f4ef49bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,10 +58,14 @@ In this release, the schema version has changed from 33 to 34. ### Fixed +- The strict SNI check setting is not persisted when the TLS configuration is changed ([#8327]). + - Status reported by the launchd service implementation in cases of scheduled service restart. - Fixed clients block/unblock when moving clients between allowed and disallowed lists. +[#8327]: https://github.com/AdguardTeam/AdGuardHome/issues/8327 + diff --git a/internal/home/tls.go b/internal/home/tls.go index 8abbc4bdf..ffabd18d9 100644 --- a/internal/home/tls.go +++ b/internal/home/tls.go @@ -590,6 +590,8 @@ func (m *tlsManager) handleTLSConfigure(w http.ResponseWriter, r *http.Request) req.PrivateKey = m.conf.PrivateKey } + req.StrictSNICheck = m.conf.StrictSNICheck + if err = m.validateTLSSettings(req); err != nil { aghhttp.ErrorAndLog(ctx, m.logger, r, w, http.StatusBadRequest, "%s", err) @@ -1053,9 +1055,9 @@ func parsePrivateKey(der []byte) (key crypto.PrivateKey, typ string, err error) } // unmarshalTLS handles base64-encoded certificates transparently -func unmarshalTLS(r *http.Request) (tlsConfigSettingsExt, error) { - data := tlsConfigSettingsExt{} - err := json.NewDecoder(r.Body).Decode(&data) +func unmarshalTLS(r *http.Request) (data tlsConfigSettingsExt, err error) { + data = tlsConfigSettingsExt{} + err = json.NewDecoder(r.Body).Decode(&data) if err != nil { return data, fmt.Errorf("failed to parse new TLS config json: %w", err) }