X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=sms-service%2Fsrc%2Fsms%2Fauth%2Fauth.go;h=8186738945b470f5e437973357f2c8990de853c5;hb=bb1feb30c22bb3e23f633ee44eed9707b2d4a3b5;hp=690fe620893b799f967c46adca70030d97a68f75;hpb=f11a02780f2210e9e734879afb1d45c89b8ed814;p=aaf%2Fsms.git diff --git a/sms-service/src/sms/auth/auth.go b/sms-service/src/sms/auth/auth.go index 690fe62..8186738 100644 --- a/sms-service/src/sms/auth/auth.go +++ b/sms-service/src/sms/auth/auth.go @@ -20,21 +20,19 @@ import ( "crypto/tls" "crypto/x509" "io/ioutil" - "log" ) var tlsConfig *tls.Config // GetTLSConfig initializes a tlsConfig using the CA's certificate // This config is then used to enable the server for mutual TLS -func GetTLSConfig(caCertFile string) *tls.Config { +func GetTLSConfig(caCertFile string) (*tls.Config, error) { // Initialize tlsConfig once if tlsConfig == nil { caCert, err := ioutil.ReadFile(caCertFile) if err != nil { - log.Fatal("Error reading CA Certificate") - log.Fatal(err) + return nil, err } caCertPool := x509.NewCertPool() @@ -47,5 +45,5 @@ func GetTLSConfig(caCertFile string) *tls.Config { } tlsConfig.BuildNameToCertificate() } - return tlsConfig + return tlsConfig, nil }