8207237: SSLSocket#setEnabledCipherSuites is accepting empty string

Reviewed-by: xuelei
This commit is contained in:
Jamil Nimeh 2018-07-18 14:32:46 -07:00
parent ba7bab5fc9
commit 1f273bde76

View file

@ -891,9 +891,10 @@ enum CipherSuite {
List<CipherSuite> cipherSuites = new ArrayList<>(names.length);
for (String name : names) {
if (name == null) {
if (name == null || name.isEmpty()) {
throw new IllegalArgumentException(
"The specified CipherSuites array contain null element");
"The specified CipherSuites array contains " +
"invalid null or empty string elements");
}
boolean found = false;