From 3a23094b814f75a37505e5926be890ef6c91fa43 Mon Sep 17 00:00:00 2001 From: kushalagrawal Date: Mon, 6 Sep 2021 18:27:19 +0530 Subject: [PATCH] Updated "CipherSuitesConverter" to make it public. (#11656) Motivation: While using netty there is sometimes need to handle the cipher suites and signature algorithm in more strict environment. CipherSuiteConverter is quite helpful in converting Cipher-Suites to and from java to openSSL. Making it public would be helpful for the project which are using netty. Modification: Updated "CipherSuitesConverter" to make it public. updated "CipherSuitesConverter.toOpenssl" to public. updated "CipherSuitesConverter.toJava" to public. Result: Fixes #11655 --- .../java/io/netty/handler/ssl/CipherSuiteConverter.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java b/handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java index cfb1a046a2..1ccd7e5a00 100644 --- a/handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java +++ b/handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java @@ -16,6 +16,7 @@ package io.netty.handler.ssl; +import io.netty.util.internal.UnstableApi; import io.netty.util.internal.logging.InternalLogger; import io.netty.util.internal.logging.InternalLoggerFactory; @@ -34,7 +35,8 @@ import static java.util.Collections.singletonMap; * * @see Wikipedia page about cipher suite */ -final class CipherSuiteConverter { +@UnstableApi +public final class CipherSuiteConverter { private static final InternalLogger logger = InternalLoggerFactory.getInstance(CipherSuiteConverter.class); @@ -150,7 +152,7 @@ final class CipherSuiteConverter { * * @return {@code null} if the conversion has failed */ - static String toOpenSsl(String javaCipherSuite, boolean boringSSL) { + public static String toOpenSsl(String javaCipherSuite, boolean boringSSL) { String converted = j2o.get(javaCipherSuite); if (converted != null) { return converted; @@ -279,7 +281,7 @@ final class CipherSuiteConverter { * @param protocol The cryptographic protocol (i.e. SSL, TLS, ...). * @return The translated cipher suite name according to java conventions. This will not be {@code null}. */ - static String toJava(String openSslCipherSuite, String protocol) { + public static String toJava(String openSslCipherSuite, String protocol) { Map p2j = o2j.get(openSslCipherSuite); if (p2j == null) { p2j = cacheFromOpenSsl(openSslCipherSuite);