mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-01-05 15:22:47 +03:00
Certificate that doesn't go through the chain is not fatal, just send the warning over json.
This commit is contained in:
parent
30050bf278
commit
57a33654f7
@ -74,6 +74,7 @@ type tlsConfig struct {
|
|||||||
StatusCertificate string `yaml:"status_cert" json:"status_cert,omitempty"`
|
StatusCertificate string `yaml:"status_cert" json:"status_cert,omitempty"`
|
||||||
StatusKey string `yaml:"status_key" json:"status_key,omitempty"`
|
StatusKey string `yaml:"status_key" json:"status_key,omitempty"`
|
||||||
Warning string `yaml:"warning" json:"warning,omitempty"`
|
Warning string `yaml:"warning" json:"warning,omitempty"`
|
||||||
|
WarningValidation string `yaml:"warning_validation" json:"warning_validation,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize to default values, will be changed later when reading config or parsing command line
|
// initialize to default values, will be changed later when reading config or parsing command line
|
||||||
|
@ -1147,8 +1147,8 @@ func validateCertificates(data tlsConfig) (tlsConfig, error) {
|
|||||||
mainCert := parsedCerts[0]
|
mainCert := parsedCerts[0]
|
||||||
_, err := mainCert.Verify(opts)
|
_, err := mainCert.Verify(opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// TODO: let self-signed certs through
|
// let self-signed certs through
|
||||||
return data, errorx.Decorate(err, "Your certificate does not verify")
|
data.WarningValidation = fmt.Sprintf("Your certificate does not verify: %s", err)
|
||||||
}
|
}
|
||||||
// spew.Dump(chains)
|
// spew.Dump(chains)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user