auth: allow for world-readable deployment mode

This commit is contained in:
Ramkumar Chinchani
2019-08-28 14:05:16 -07:00
parent ae6651a919
commit 10199457b4
9 changed files with 340 additions and 36 deletions
+5 -5
View File
@@ -45,13 +45,13 @@ func (c *Controller) Run() error {
return err
}
clientAuth := tls.VerifyClientCertIfGiven
if c.Config.HTTP.Auth.HTPasswd.Path == "" {
clientAuth = tls.RequireAndVerifyClientCert
}
if c.Config.HTTP.TLS.Key != "" && c.Config.HTTP.TLS.Cert != "" {
if c.Config.HTTP.TLS.CACert != "" {
clientAuth := tls.VerifyClientCertIfGiven
if c.Config.HTTP.Auth.HTPasswd.Path == "" && !c.Config.HTTP.AllowReadAccess {
clientAuth = tls.RequireAndVerifyClientCert
}
caCert, err := ioutil.ReadFile(c.Config.HTTP.TLS.CACert)
if err != nil {
panic(err)