diff --git a/src/main/java/org/fisco/bcos/sdk/v3/config/model/CryptoMaterialConfig.java b/src/main/java/org/fisco/bcos/sdk/v3/config/model/CryptoMaterialConfig.java index 364645c0c..a8de417ed 100644 --- a/src/main/java/org/fisco/bcos/sdk/v3/config/model/CryptoMaterialConfig.java +++ b/src/main/java/org/fisco/bcos/sdk/v3/config/model/CryptoMaterialConfig.java @@ -52,11 +52,19 @@ public CryptoMaterialConfig(ConfigProperty configProperty) throws ConfigExceptio Map cryptoMaterialProperty = configProperty.getCryptoMaterial(); String useSMCrypto = (String) cryptoMaterialProperty.get("useSMCrypto"); - String disableSsl = (String) cryptoMaterialProperty.get("disableSsl"); + Object disableSsl = cryptoMaterialProperty.get("disableSsl"); + Object enableSsl = cryptoMaterialProperty.get("enableSsl"); String enableHsm = (String) cryptoMaterialProperty.get("enableHsm"); this.useSmCrypto = Boolean.valueOf(useSMCrypto); - this.disableSsl = Boolean.valueOf(disableSsl); + if (disableSsl != null) { + this.disableSsl = Boolean.parseBoolean((String) disableSsl); + } + if (enableSsl != null) { + // if enableSsl is set, disableSsl will be ignored + this.disableSsl = !Boolean.parseBoolean((String) enableSsl); + } + this.enableHsm = Boolean.valueOf(enableHsm); if (this.enableHsm) { diff --git a/src/test/resources/applicationContext-sample.xml b/src/test/resources/applicationContext-sample.xml index 25fc1d544..4efc9e5b3 100644 --- a/src/test/resources/applicationContext-sample.xml +++ b/src/test/resources/applicationContext-sample.xml @@ -9,7 +9,7 @@ - + diff --git a/src/test/resources/config-example.toml b/src/test/resources/config-example.toml index b99d1ce45..794cce926 100644 --- a/src/test/resources/config-example.toml +++ b/src/test/resources/config-example.toml @@ -2,7 +2,7 @@ certPath = "conf" # The certification path useSMCrypto = "false" -disableSsl = "false" # Communication with nodes without SSL +enableSsl = "true" # Communication with nodes without SSL # The following configurations take the certPath by default if commented # caCert = "conf/ca.crt" # CA cert file path diff --git a/src/test/resources/config.toml b/src/test/resources/config.toml index b99d1ce45..794cce926 100644 --- a/src/test/resources/config.toml +++ b/src/test/resources/config.toml @@ -2,7 +2,7 @@ certPath = "conf" # The certification path useSMCrypto = "false" -disableSsl = "false" # Communication with nodes without SSL +enableSsl = "true" # Communication with nodes without SSL # The following configurations take the certPath by default if commented # caCert = "conf/ca.crt" # CA cert file path