Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
Improve certificates loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelvin-M committed Nov 6, 2020
1 parent ac8347c commit 0fb957f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chaincode/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 0fb957f

Please sign in to comment.