[CORDA:936]: Enable RPC layer to work with SSL

This commit is contained in:
Michele Sollecito
2018-01-23 16:23:37 +00:00
committed by GitHub
parent 70f1fdeb2b
commit 142f52fa82
55 changed files with 1563 additions and 366 deletions

View File

@ -2,8 +2,8 @@ package net.corda.webserver
import com.typesafe.config.Config
import net.corda.core.utilities.NetworkHostAndPort
import net.corda.nodeapi.internal.config.User
import net.corda.nodeapi.internal.config.NodeSSLConfiguration
import net.corda.nodeapi.internal.config.User
import net.corda.nodeapi.internal.config.getValue
import java.nio.file.Path
@ -16,7 +16,15 @@ class WebServerConfig(override val baseDirectory: Path, val config: Config) : No
val exportJMXto: String get() = "http"
val useHTTPS: Boolean by config
val myLegalName: String by config
val rpcAddress: NetworkHostAndPort by config
val rpcAddress: NetworkHostAndPort by lazy {
if (config.hasPath("rpcSettings.address")) {
return@lazy NetworkHostAndPort.parse(config.getString("rpcSettings.address"))
}
if (config.hasPath("rpcAddress")) {
return@lazy NetworkHostAndPort.parse(config.getString("rpcAddress"))
}
throw Exception("Missing rpc address property. Either 'rpcSettings' or 'rpcAddress' must be specified.")
}
val webAddress: NetworkHostAndPort by config
val rpcUsers: List<User> by config
}