0

I have written code in JDK 1.6

SSLContext context = SSLContext.getInstance("TLS");
        context.init(null, tmf.getTrustManagers(), null);
        SSLParameters params = context.getSupportedSSLParameters();
        List<String> enabledCiphers = new ArrayList<String>();
        for (String cipher : params.getCipherSuites()) {
            boolean exclude = false;
            if (exludedCipherSuites != null) {
                for (int i = 0; i < exludedCipherSuites.length && !exclude; i++) {
                    exclude = cipher.indexOf(exludedCipherSuites[i]) >= 0;
                }
            }
            if (!exclude) {
                enabledCiphers.add(cipher);
            }
        }
        String[] cArray = new String[enabledCiphers.size()];



        SSLSocketFactory sf = context.getSocketFactory();
        sf = new DOSSLSocketFactory(sf, cArray);
        urlConnection.setSSLSocketFactory(sf);

The problem is that, in JDK 1.5 I do not have SSLParameters. How can I solve the problem in JDK 1.5?

grep
  • 5,465
  • 12
  • 60
  • 112

1 Answers1

0

Assuming you want the supported cipher suites you could use SSLSocketFactory.getSupportedCipherSuites(). See that.

Community
  • 1
  • 1
Jan
  • 1,004
  • 6
  • 23