Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<fix>(config): add enableSsl config, it will cover disableSsl config. #923

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,19 @@ public CryptoMaterialConfig(ConfigProperty configProperty) throws ConfigExceptio

Map<String, Object> 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) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/applicationContext-sample.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<map>
<entry key="certPath" value="conf" />
<entry key="useSMCrypto" value="false" />
<entry key="disableSsl" value="false" />
<entry key="enableSsl" value="true" />
<!-- SSL certificate configuration -->
<!-- entry key="caCert" value="conf/ca.crt" /-->
<!-- entry key="sslCert" value="conf/sdk.crt" /-->
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/config-example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading