8207237: SSLSocket#setEnabledCipherSuites is accepting empty string

Reviewed-by: xuelei
This commit is contained in:
Jamil Nimeh 2018-07-25 09:48:31 -07:00
parent 021a771791
commit 8158cca17d

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;