WebSphere Application Server & Liberty

 View Only
  • 1.  How to find out which cipher suites are available on WAS Java

    Posted 12 days ago

    I use multiple versions of WAS java in multiple environments. 

    I would like to know what cipher suites are available for each Java environment. How can I find this out?

    ( For example, how can I find out what cipher suites are available in IBM SDK 7.0.9.60 ? )



    ------------------------------
    Ken Iida
    Ken.Iida@kyndryl.com
    NagoyaJapan
    ------------------------------


  • 2.  RE: How to find out which cipher suites are available on WAS Java

    Posted 11 days ago

    Hello Ken, 

    I use the following javacode:

    import java.util.Iterator;
    import java.util.Map;
    import java.util.TreeMap;
    import javax.net.ssl.SSLServerSocketFactory;
     
    public class Ciphers
    {
        public static void main(String[] args)
            throws Exception
        {
            SSLServerSocketFactory ssf = (SSLServerSocketFactory)SSLServerSocketFactory.getDefault();
     
            String[] defaultCiphers = ssf.getDefaultCipherSuites();
            String[] availableCiphers = ssf.getSupportedCipherSuites();
     
            TreeMap<String, Boolean> ciphers = new TreeMap<String, Boolean>();
     
            for(int i=0; i<availableCiphers.length; ++i )
                ciphers.put(availableCiphers[i], Boolean.FALSE);
     
            for(int i=0; i<defaultCiphers.length; ++i )
                ciphers.put(defaultCiphers[i], Boolean.TRUE);
     
            System.out.println("Default\tCipher");
            for(Iterator i = ciphers.entrySet().iterator(); i.hasNext(); ) {
                Map.Entry cipher=(Map.Entry)i.next();
     
                if(Boolean.TRUE.equals(cipher.getValue()))
                    System.out.print('*');
                else
                    System.out.print(' ');
     
                System.out.print('\t');
                System.out.println(cipher.getKey());
            }
        }
    }

    Best regards 

    André



    ------------------------------
    Andre Jahn
    WebAdministrator
    Deutsche Bundesbank
    Duesseldorf
    1-555-555-5555
    ------------------------------