Pull request 2619: 8327-fix-tls-settings-rewrite

Updates #8327.

Squashed commit of the following:

commit 049839387a70db6886a3dd6806ba0351ec19621e
Merge: 9dfbdf917 4dc7d9d39
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Wed Apr 8 14:55:44 2026 +0300

    Merge branch 'master' into 8327-fix-tls-settings-rewrite

commit 9dfbdf917f30df1c17bce4862b19357679928450
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Mon Apr 6 16:19:45 2026 +0300

    home: fix tls config rewrite
This commit is contained in:
Eugene Burkov committed 2026-04-08 12:12:53 +00:00
1 parent 4dc7d9d39a
commit bb18985429
2 files changed
+9 -3

No files matched your search

+4
View File
@@ -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
<!--
NOTE: Add new changes ABOVE THIS COMMENT.
-->
+5 -3
View File
@@ -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)
}