Register crypto providers after we init logging (#3067)

* Register crypto providers after we init logging
This commit is contained in:
cburlinchon 2018-05-03 16:24:54 +01:00 committed by GitHub
parent a61aa5d645
commit fe87f16d98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -3,15 +3,10 @@
package net.corda.node
import net.corda.core.crypto.CordaSecurityProvider
import net.corda.core.crypto.Crypto
import net.corda.node.internal.NodeStartup
import kotlin.system.exitProcess
fun main(args: Array<String>) {
// Register all cryptography [Provider]s first thing on boot.
// Required to install our [SecureRandom] before e.g., UUID asks for one.
Crypto.registerProviders()
// Pass the arguments to the Node factory. In the Enterprise edition, this line is modified to point to a subclass.
// It will exit the process in case of startup failure and is not intended to be used by embedders. If you want
// to embed Node in your own container, instantiate it directly and set up the configuration objects yourself.

View File

@ -1,6 +1,7 @@
package net.corda.node.internal
import com.jcabi.manifests.Manifests
import net.corda.core.crypto.Crypto
import net.corda.core.internal.Emoji
import net.corda.core.internal.concurrent.thenMatch
import net.corda.core.internal.createDirectories
@ -55,6 +56,11 @@ open class NodeStartup(val args: Array<String>) {
initLogging(cmdlineOptions)
// Register all cryptography [Provider]s.
// Required to install our [SecureRandom] before e.g., UUID asks for one.
// This needs to go after initLogging(netty clashes with our logging).
Crypto.registerProviders()
val versionInfo = getVersionInfo()
if (cmdlineOptions.isVersion) {