为什么我无法禁用SSLv3?

时间:2015-11-11 09:35:51

标签: sslv3

我在服务器端禁用了sslv3,如下所示:

            char certPass[] = "***";
            char certAliaMainPass[] = "***";;
            KeyStore keyStore = KeyStore.getInstance("JKS");
            keyStore.load(new FileInputStream(certPath), certPass);
            KeyManagerFactory keyManagerFactory =         KeyManagerFactory.getInstance("SunX509");
            keyManagerFactory.init(keyStore, certAliaMainPass);
            SSLContext sslContext = SSLContext.getInstance("TLS");
            sslContext.init(keyManagerFactory.getKeyManagers(), null, null);
            SSLServerSocketFactory sslServerSocketFactory = sslContext.getServerSocketFactory();
            sslServerSocket = (SSLServerSocket) sslServerSocketFactory.createServerSocket(iPort);

            String[] protocols = sslServerSocket.getEnabledProtocols();
            Set<String> set = new HashSet<String>();
            for (String s : protocols) {
                if (s.equals("SSLv3")) {
                    continue;
                }
                set.add(s);
            }
            sslServerSocket.setEnabledProtocols(set.toArray(new String[0]));

但客户使用&#34; SSLv3&#34;仍然可以连接到服务器,我该怎么办?

1 个答案:

答案 0 :(得分:0)

  1. 转到Java安装文件夹。
  2. 在文字编辑器中打开{JRE_HOME}\lib\security\java.security -file
  3. 转到最后一行。
  4. 删除或注释掉以下行jdk.tls.disabledAlgorithms=SSLv3