Use reference variable while reading certificates

This commit is contained in:
Prathamesh Musale 2023-10-17 17:21:37 +05:30
parent 88ccedda33
commit 782548e4af

View File

@ -116,15 +116,15 @@ func serve() {
tlsCertFilepath := ""
tlsKeyFilepath := ""
var cert tls.Certificate
var cert *tls.Certificate
if tlsCertFilepath != "" && tlsKeyFilepath != "" {
cert, err = tls.LoadX509KeyPair(tlsCertFilepath, tlsKeyFilepath)
*cert, err = tls.LoadX509KeyPair(tlsCertFilepath, tlsKeyFilepath)
if err != nil {
logWithCommand.Fatal(err)
}
}
nitroRpcServer, err := initNitroRpcServer(nitroNode, pm, &cert, rpcPort)
nitroRpcServer, err := initNitroRpcServer(nitroNode, pm, cert, rpcPort)
if err != nil {
logWithCommand.Fatal(err)
}