Skip to content

Commit

Permalink
Merge branch '3.2.x' into 3.3.x
Browse files Browse the repository at this point in the history
Closes gh-43083
  • Loading branch information
philwebb committed Nov 9, 2024
2 parents 571bd59 + 4f7de1c commit 239ee14
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -72,4 +72,22 @@ void ofWithNullSetCreatesSslOptions() {
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();
}

}

0 comments on commit 239ee14

Please sign in to comment.