From 0fb957fe7fc7b9f9f765e1d7e836096f2f2d4c2f Mon Sep 17 00:00:00 2001 From: Kelvin Moutet Date: Wed, 4 Nov 2020 10:06:14 +0100 Subject: [PATCH] Improve certificates loading --- chaincode/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chaincode/main.go b/chaincode/main.go index 7bb3c2cf..5862dc2e 100644 --- a/chaincode/main.go +++ b/chaincode/main.go @@ -234,17 +234,17 @@ func main() { logger.SetLevel(logrus.DebugLevel) logger.Infof("Load TLS certificates") - key, err := ioutil.ReadFile("/var/hyperledger/tls/client/pair/tls.key") + key, err := ioutil.ReadFile(os.Getenv("TLS_KEY_FILE")) if err != nil { logger.Errorf("Cannot read key file: %s", err) } - cert, err := ioutil.ReadFile("/var/hyperledger/tls/client/pair/tls.crt") + cert, err := ioutil.ReadFile(os.Getenv("TLS_CERT_FILE")) if err != nil { logger.Errorf("Cannot read cert file: %s", err) } - ca, err := ioutil.ReadFile("/var/hyperledger/tls/client/cert/cacert.pem") + ca, err := ioutil.ReadFile(os.Getenv("TLS_ROOTCERT_FILE")) if err != nil { logger.Errorf("Cannot read ca cert file: %s", err) }