adding separator

This commit is contained in:
afeiszli
2022-04-25 20:07:47 -04:00
parent cfb0904bd6
commit 13db6ced0c
7 changed files with 22 additions and 13 deletions

View File

@@ -178,7 +178,7 @@ func messageQueue(ctx context.Context, server string) {
// NewTLSConf sets up tls configuration to connect to broker securely
func NewTLSConfig(server string) *tls.Config {
file := ncutils.GetNetclientServerPath(server) + "/root.pem"
file := ncutils.GetNetclientServerPath(server) + ncutils.GetSeparator() + "root.pem"
certpool := x509.NewCertPool()
ca, err := os.ReadFile(file)
if err != nil {
@@ -188,7 +188,7 @@ func NewTLSConfig(server string) *tls.Config {
if !ok {
logger.Log(0, "failed to append cert")
}
clientKeyPair, err := tls.LoadX509KeyPair(ncutils.GetNetclientServerPath(server)+"/client.pem", ncutils.GetNetclientPath()+"/client.key")
clientKeyPair, err := tls.LoadX509KeyPair(ncutils.GetNetclientServerPath(server)+ncutils.GetSeparator()+"client.pem", ncutils.GetNetclientPath()+"/client.key")
if err != nil {
log.Fatalf("could not read client cert/key %v \n", err)
}