summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/daq/s5proxy/src/s5proxy/config.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/daq/s5proxy/src/s5proxy/config.go b/src/daq/s5proxy/src/s5proxy/config.go
index 07d4c3c..1aa773a 100644
--- a/src/daq/s5proxy/src/s5proxy/config.go
+++ b/src/daq/s5proxy/src/s5proxy/config.go
@@ -215,6 +215,14 @@ func readConfig(configfile string) (conf *Config, err error) {
conf = &Config{}
conf.SFive.Duration = 10000
- err = json.NewDecoder(f).Decode(conf)
+ if err = json.NewDecoder(f).Decode(conf); err != nil {
+ return
+ }
+ if conf.Protocol == HTTPAndHTTPS || conf.Protocol == HTTPSOnly {
+ if conf.CertFile == "" || conf.KeyFile == "" {
+ return nil, errors.New("HTTPs is enabled but no certificate and/or key file is supplied")
+ }
+ }
+
return
}