Fixed typo in option name in CLI dependency check: tls-cipher-suite (#3168)

* added test for specifying cipher-suite without tls

Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>

* fixed option name in dependency check

Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>

Co-authored-by: Antony Denyer <git@antonydenyer.co.uk>
pull/3175/head
Sally MacFarlane 3 years ago committed by GitHub
parent b9bfee783e
commit 3ee6bed676
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
  2. 24
      besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java

@ -1948,7 +1948,8 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
"--rpc-http-tls-ca-clients-enabled",
"--rpc-http-authentication-jwt-algorithm",
"--rpc-http-tls-protocols",
"--rpc-http-tls-ciphersuites"));
"--rpc-http-tls-cipher-suite",
"--rpc-http-tls-cipher-suites"));
}
private void checkRpcTlsOptionsDependencies() {
@ -1964,7 +1965,8 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
"--rpc-http-tls-known-clients-file",
"--rpc-http-tls-ca-clients-enabled",
"--rpc-http-tls-protocols",
"--rpc-http-tls-ciphersuites"));
"--rpc-http-tls-cipher-suite",
"--rpc-http-tls-cipher-suites"));
}
private void checkRpcTlsClientAuthOptionsDependencies() {

@ -2471,6 +2471,30 @@ public class BesuCommandTest extends CommandTestAbstract {
assertThat(commandErrorOutput.toString()).isEmpty();
}
@Test
public void rpcHttpTlsWarnIfCipherSuitesSpecifiedWithoutTls() {
final String host = "1.2.3.4";
final int port = 1234;
final String cipherSuites = "Invalid";
parseCommand(
"--rpc-http-enabled",
"--rpc-http-host",
host,
"--rpc-http-port",
String.valueOf(port),
"--rpc-http-tls-cipher-suite",
cipherSuites);
verify(mockLogger)
.warn(
"{} has been ignored because {} was not defined on the command line.",
"--rpc-http-tls-cipher-suite",
"--rpc-http-tls-enabled");
assertThat(commandOutput.toString()).isEmpty();
assertThat(commandErrorOutput.toString()).isEmpty();
}
@Test
public void graphQLHttpHostAndPortOptionsMustBeUsed() {

Loading…
Cancel
Save