forked from cerc-io/ipld-eth-server
Make TLS certs for Nitro node optional
This commit is contained in:
parent
6339aa3f88
commit
88ccedda33
13
cmd/serve.go
13
cmd/serve.go
@ -113,12 +113,15 @@ func serve() {
|
|||||||
|
|
||||||
// TODO: Read from config file
|
// TODO: Read from config file
|
||||||
rpcPort := 4005
|
rpcPort := 4005
|
||||||
tlsCertFilepath := "./nitroTLS/statechannels.org.pem"
|
tlsCertFilepath := ""
|
||||||
tlsKeyFilepath := "./nitroTLS/statechannels.org_key.pem"
|
tlsKeyFilepath := ""
|
||||||
|
|
||||||
cert, err := tls.LoadX509KeyPair(tlsCertFilepath, tlsKeyFilepath)
|
var cert tls.Certificate
|
||||||
if err != nil {
|
if tlsCertFilepath != "" && tlsKeyFilepath != "" {
|
||||||
logWithCommand.Fatal(err)
|
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)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user