diff options
author | Kiran Kamineni <kiran.k.kamineni@intel.com> | 2018-04-26 17:31:07 -0700 |
---|---|---|
committer | Kiran Kamineni <kiran.k.kamineni@intel.com> | 2018-04-26 17:31:12 -0700 |
commit | 56a620d02f2b39ce64d07007902b53544d235a59 (patch) | |
tree | 62c162f0d19314c61274fe0d709320aaefcffa55 /sms-service/src/quorumclient/quorumclient.go | |
parent | 30dae56d353d324e97e13a47891c30f384a66be9 (diff) |
Adding cert files to support https
Adding cert files generated by AAF CA
Incorporating them into the docker build as well
Issue-ID: AAF-265
Change-Id: I1ee1e031bf058a0325fe2c6fe8eed5e3948d70e7
Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'sms-service/src/quorumclient/quorumclient.go')
-rw-r--r-- | sms-service/src/quorumclient/quorumclient.go | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/sms-service/src/quorumclient/quorumclient.go b/sms-service/src/quorumclient/quorumclient.go index 51dfc9c..9db6da8 100644 --- a/sms-service/src/quorumclient/quorumclient.go +++ b/sms-service/src/quorumclient/quorumclient.go @@ -64,14 +64,14 @@ func loadPGPKeys(prKeyPath string, pbKeyPath string) (string, string, error) { //calls necessary initialization endpoints on the //SMS webservice func main() { - folderName := os.Getenv("HOSTNAME") + folderName := filepath.Join("auth", os.Getenv("HOSTNAME")) //Make sure to create the folder. It is not guaranteed to exist os.MkdirAll(folderName, 0700) - idFilePath := filepath.Join("auth", folderName, "id") - pbKeyPath := filepath.Join("auth", folderName, "pbkey") - prKeyPath := filepath.Join("auth", folderName, "prkey") - shardPath := filepath.Join("auth", folderName, "shard") + idFilePath := filepath.Join(folderName, "id") + pbKeyPath := filepath.Join(folderName, "pbkey") + prKeyPath := filepath.Join(folderName, "prkey") + shardPath := filepath.Join(folderName, "shard") smslogger.Init("quorum.log") smslogger.WriteInfo("Starting Log for Quorum Client") @@ -138,11 +138,14 @@ func main() { caCertPool := x509.NewCertPool() caCertPool.AppendCertsFromPEM(caCert) - // Load the client certificate files - //cert, err := tls.LoadX509KeyPair(cfg.ClientCert, cfg.ClientKey) - //if err != nil { - // log.Fatalf("Error while loading key pair %v ", err) - //} + /* + Support Client certificates once we have auto generated certs + Load the client certificate files + cert, err := tls.LoadX509KeyPair(cfg.ClientCert, cfg.ClientKey) + if err != nil { + log.Fatalf("Error while loading key pair %v ", err) + } + */ transport.TLSClientConfig = &tls.Config{ MinVersion: tls.VersionTLS12, @@ -171,7 +174,6 @@ func main() { Seal bool `json:"sealstatus"` } err = json.NewDecoder(response.Body).Decode(&data) - sealed := data.Seal // Unseal the vault if sealed |