問題描述
以下代碼列出了 Java SE 8 支持的密碼套件:
The following code lists the supported cipher suites by Java SE 8:
import java.io.IOException;
import java.net.UnknownHostException;
import java.util.Arrays;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLSocketFactory;
public class ListCiphers {
public static void main(String[] args) throws UnknownHostException, IOException
{
SSLSocketFactory factory = HttpsURLConnection.getDefaultSSLSocketFactory();
String[] cipherSuites = factory.getSupportedCipherSuites();
System.out.println(Arrays.toString(cipherSuites));
} //end main
}
我想制作配置了一些特定密碼套件列表的 SSL 客戶端.我想使用的密碼套件是標準化的,但 Jva SE 8 不支持.例如,這個密碼在 firefox 中列出:
I want to make SSL client which is configured with some specific list of cipher suites. The cipher suites I want to use are standardized but not supported by Jva SE 8. For example, this cipher is listed in firefox:
ECDHE_ECDSA_WITH_AES_256_SHA
請幫助我以任何方式允許我在我的 SSL 客戶端中編輯密碼套件列表.充氣城堡對此有幫助嗎?如何?請一步一步給我清楚.另外,如果您知道我想要什么可以通過使用其他語言(例如 python)來實現,也請幫助我.
Please, help me with any way that allows me to edit the list of cipher suite in my SSL client. Does Bouncy Castle help in this? How? Please, give me clear step by step. Also if you knwo what I want can be achieved by using another language such as python, also please help me.
推薦答案
如何使用 Bouncy Castle 編輯 Java 中的密碼套件列表
How can I edit the list of cipher suite in Java using Bouncy Castle
請參閱要為 SSL 套接字啟用哪些密碼套件? 并使用 SSLSocketFactoryEx
.它是 Java 的 SSLSocketFactory
See Which Cipher Suites to enable for SSL Socket? and use SSLSocketFactoryEx
. Its a drop-in replacement for Java's SSLSocketFactory
如果你不想使用 SSLSocketFactoryEx
,那么就撕掉代碼來找到密碼套件的交集.
If you don't want to use SSLSocketFactoryEx
, then rip the code to find the intersection of cipher suites.
它控制協(xié)議和密碼套件.沒有意外的驚喜,例如從 SSLSocketFactory.getInstance("TLS");
獲取 SSLv3 套接字.
It controls both protocols and cipher suites. There are no unexpected surprises, like getting a SSLv3 socket back from SSLSocketFactory.getInstance("TLS");
.
沒有什么是可配置的,所以用戶不能在腳上開槍.它也為 TLS 1.3 做好了準備
Nothing is configurable, so the user cannot shoot themselves in the foot. It's also ready for TLS 1.3
這篇關于如何使用 Bouncy Castle 編輯 Java 中的密碼套件列表的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!