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) }