Fixes #387 - Check whether the certificate / privkey is set before trying to load it.

This commit is contained in:
J.C. Jones 2015-06-22 06:06:26 -07:00
parent 8a1761b4f9
commit 4a495d0874
1 changed files with 4 additions and 0 deletions

View File

@ -214,6 +214,10 @@ func AmqpChannel(conf Config) (*amqp.Channel, error) {
err := fmt.Errorf("SSL configuration provided, but not using an AMQPS URL")
return nil, err
}
if len(conf.AMQP.SSL.CertFile) == 0 || len(conf.AMQP.SSL.KeyFile) == 0 {
err := fmt.Errorf("Configuration values AMQP.SSL.KeyFile and AMQP.SSL.CertFile may not be nil.")
return nil, err
}
cfg := new(tls.Config)