[ 
https://issues.apache.org/jira/browse/GEODE-8070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17101842#comment-17101842
 ] 

Jacob Barrett commented on GEODE-8070:
--------------------------------------

I suggest we rewrite "any" as "Default" too. The current method skips over 
"any", which takes it out of the ordered priority list and places it last 
effectively. This doesn't feel right. How about this:
{code:java}
  public static SSLContext getSSLContextInstance(SSLConfig sslConfig) {
    String[] protocols = sslConfig.getProtocolsAsStringArray();
    SSLContext sslContext = null;
    if (protocols != null && protocols.length > 0) {
      for (String protocol : protocols) {
        if ("any".equals(protocol)) {
          protocol = "Default";
        }
        try {
          sslContext = SSLContext.getInstance(protocol);
          break;
        } catch (NoSuchAlgorithmException e) {
          // continue
        }
      }
      if (sslContext != null) {
        throw new NoSuchAlgorithmException();
      }
    }
    
    return SSLContext.getInstance("Default");
  }
{code}


> rework handling of "any" in SSLUtils
> ------------------------------------
>
>                 Key: GEODE-8070
>                 URL: https://issues.apache.org/jira/browse/GEODE-8070
>             Project: Geode
>          Issue Type: Bug
>          Components: membership
>            Reporter: Bruce J Schuchardt
>            Priority: Major
>
> SSLUtil has a list of "known" TLS protocols.  It should support TLSv1.3.
>  
> {noformat}
> // lookup known algorithms
> String[] knownAlgorithms = {"SSL", "SSLv2", "SSLv3", "TLS", "TLSv1", 
> "TLSv1.1", "TLSv1.2"};
> for (String algo : knownAlgorithms) {
>   try {
>     sslContext = SSLContext.getInstance(algo);
>     break;
>   } catch (NoSuchAlgorithmException e) {
>     // continue
>   }
> } {noformat}
> We probably can't fully test this change since not all JDKs we test with 
> support v1.3 at this time.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to