1

我使用 javax.net.ssl.SSLContext 类实现安全连接,代码:

        ...
        SSLContext sslcontext = SSLContext.getInstance("TLS");
        sslcontext.init(null, trustManager, null);
        SSLSocketFactory sf = new SSLSocketFactory(sslcontext);
        ...

我想禁用弱 ssl 密码。怎么做?

4

3 回答 3

0

Have you looked at the JavaDoc for SSLSocketFactory? I paraphrase

...Normally, only a subset of these will actually be enabled by default, since this list may include cipher suites which do not meet quality of service requirements...

In other words, you probably shouldn't worry, but if you do, you can explicitly supply your own implementation/extension of the default impl of SSLSocketFactory and override said method, or simply set the cipher suites you want enabled on your SSLSocket.

Cheers,

于 2012-12-18T12:27:01.413 回答
0

他们已经被禁用。如果要禁用更多密码套件,请使用SSLSocket.setEnabledCipherSuites().

于 2012-12-19T09:23:13.620 回答
0

您可以使用3rd 方 SSLContext 构建器,它允许您为密码指定白名单和黑名单。

于 2018-05-07T15:29:08.497 回答