Make TLS certs for Nitro node optional

This commit is contained in:
Prathamesh Musale 2023-10-17 16:42:08 +05:30
parent 6339aa3f88
commit 88ccedda33

View File

@ -113,12 +113,15 @@ func serve() {
// TODO: Read from config file
rpcPort := 4005
tlsCertFilepath := "./nitroTLS/statechannels.org.pem"
tlsKeyFilepath := "./nitroTLS/statechannels.org_key.pem"
tlsCertFilepath := ""
tlsKeyFilepath := ""
cert, err := tls.LoadX509KeyPair(tlsCertFilepath, tlsKeyFilepath)
if err != nil {
logWithCommand.Fatal(err)
var cert tls.Certificate
if tlsCertFilepath != "" && tlsKeyFilepath != "" {
cert, err = tls.LoadX509KeyPair(tlsCertFilepath, tlsKeyFilepath)
if err != nil {
logWithCommand.Fatal(err)
}
}
nitroRpcServer, err := initNitroRpcServer(nitroNode, pm, &cert, rpcPort)