Browse Source

Merge branch '3.2.x' into 3.3.x

Closes gh-43083
pull/43333/head
Phillip Webb 1 year ago
parent
commit
239ee146af
  1. 2
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ssl/SslOptions.java
  2. 20
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ssl/SslOptionsTests.java

2
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ssl/SslOptions.java

@ -45,7 +45,7 @@ public interface SslOptions { @@ -45,7 +45,7 @@ public interface SslOptions {
* @return {@code true} if SSL options have been specified
*/
default boolean isSpecified() {
return (getCiphers() != null) && (getEnabledProtocols() != null);
return (getCiphers() != null) || (getEnabledProtocols() != null);
}
/**

20
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ssl/SslOptionsTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -72,4 +72,22 @@ class SslOptionsTests { @@ -72,4 +72,22 @@ class SslOptionsTests {
assertThat(options.getEnabledProtocols()).isNull();
}
@Test
void isSpecifiedWhenHasCiphers() {
SslOptions options = SslOptions.of(Set.of("a", "b", "c"), null);
assertThat(options.isSpecified()).isTrue();
}
@Test
void isSpecifiedWhenHasEnabledProtocols() {
SslOptions options = SslOptions.of(null, Set.of("d", "e", "f"));
assertThat(options.isSpecified()).isTrue();
}
@Test
void isSpecifiedWhenHasNoCiphersOrEnabledProtocols() {
SslOptions options = SslOptions.NONE;
assertThat(options.isSpecified()).isFalse();
}
}

Loading…
Cancel
Save