Skip to content

Commit 3c8688a

Browse files
committed
[fix] regression introduced at #222
setSuite params indicates necessary cipher suite initialization
1 parent 66a893b commit 3c8688a

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/main/java/org/jruby/ext/openssl/CipherStrings.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -562,14 +562,21 @@ static Collection<Def> matchingCiphers(final String cipherString, final String[]
562562

563563
private static Collection<Def> matchingExact(final String name, final String[] all,
564564
final boolean setSuite) {
565-
Def pattern = Definitions.get(name);
566-
if ( pattern != null ) {
565+
final Def pattern = Definitions.get(name);
566+
if (pattern != null) {
567567
return matchingPattern(pattern, all, true, setSuite);
568568
}
569-
else {
570-
Def cipher = CipherNames.get(name);
571-
if (cipher != null) {
572-
return Collections.singleton(cipher);
569+
570+
final Def def = CipherNames.get(name);
571+
if (def != null) {
572+
if (setSuite) {
573+
for (final String entry : all) {
574+
if (name.equals(SuiteToOSSL.get(entry))) {
575+
return Collections.singleton(def.setCipherSuite(entry));
576+
}
577+
}
578+
} else {
579+
return Collections.singleton(def);
573580
}
574581
}
575582
return null; // Collections.emptyList();

0 commit comments

Comments
 (0)