changed based on review

1. exit AG is user defined cipher is invalid
2. updated changelog
3. golang naming tweaks
This commit is contained in:
Rahul Somasundaram 2022-10-06 21:37:15 +05:30
parent 15b19ff726
commit 7cac010573
No known key found for this signature in database
GPG key ID: AA8F0B27E83147BD
4 changed files with 39 additions and 28 deletions
internal/home

View file

@ -369,6 +369,11 @@ func initWeb(args options, clientBuildFS fs.FS) (web *Web, err error) {
}
}
tlsCiphers, err := getTLSCiphers()
if err != nil {
return nil, err
}
webConf := webConfig{
firstRun: Context.firstRun,
BindHost: config.BindHost,
@ -383,7 +388,7 @@ func initWeb(args options, clientBuildFS fs.FS) (web *Web, err error) {
clientBetaFS: clientBetaFS,
serveHTTP3: config.DNS.ServeHTTP3,
tlsCiphers: getTLSCiphers(),
tlsCiphers: tlsCiphers,
}
web = newWeb(&webConf)
@ -889,15 +894,13 @@ type jsonError struct {
Message string `json:"message"`
}
// getTLSCiphers check for overriden tls ciphers, if the slice is
// getTLSCiphers check for overridden tls ciphers, if the slice is
// empty, then default safe ciphers are used
func getTLSCiphers() []uint16 {
var cipher []uint16
func getTLSCiphers() (cipherIds []uint16, err error) {
if len(config.TLS.OverrideTLSCiphers) == 0 {
cipher = aghtls.SaferCipherSuites()
return aghtls.SaferCipherSuites(), nil
} else {
cipher = aghtls.ParseCipherIDs(config.TLS.OverrideTLSCiphers)
log.Info("Overriding TLS Ciphers : %s", config.TLS.OverrideTLSCiphers)
return aghtls.ParseCipherIDs(config.TLS.OverrideTLSCiphers)
}
return cipher
}