在JAVA windows中更新密码列表
我需要在Windows上使用java(jre1.8.0_65)发送安全请求, 我使用下面的代码来配置我的证书和密钥工厂在JAVA windows中更新密码列表,java,ssl,https,Java,Ssl,Https,我需要在Windows上使用java(jre1.8.0_65)发送安全请求, 我使用下面的代码来配置我的证书和密钥工厂 KeyStore ks = KeyStore.getInstance("PKCS12"); //FileInputStream fis = new FileInputStream("certs/tester1024.pfx"); InputStream ins = this.getClass().getClassLoader() .getResourceAsStrea
KeyStore ks = KeyStore.getInstance("PKCS12");
//FileInputStream fis = new FileInputStream("certs/tester1024.pfx");
InputStream ins = this.getClass().getClassLoader()
.getResourceAsStream("certs/tester1024.pfx");
ks.load(ins, "1234".toCharArray());
KeyManagerFactory kmf = KeyManagerFactory.getInstance("SUNX509");
kmf.init(ks, "1234".toCharArray());
SSLContext sc = SSLContext.getInstance("TLS");
sc.init(kmf.getKeyManagers(), null, null);
URL obj = new URL(httpURL);
HttpURLConnection connection = (HttpURLConnection) obj.openConnection();
if (connection instanceof HttpsURLConnection) {
((HttpsURLConnection)connection)
.setSSLSocketFactory(sc.getSocketFactory());
}
connection.setRequestMethod(method);
responseCode = connection.getResponseCode();
上面的代码可以工作,但“客户机你好”中发送给客户机的密码列表不包括密码TLS\U RSA\U和\U AES\U256\U CBC\U SHA256
它包括此TLS_RSA_和_AES_128_CBC_SHA256
在客户端Hello密码列表中,我希望包含此密码
我需要在windows上更新任何与JAVA相关的东西,因为在linux上,同一个JAVA应用程序包含两个密码 如果您使用Oracle以前的Sun JRE(或JDK),要将SSL/TLS套件与256位对称密码一起使用,或以任何其他方式使用>128位对称密码,则必须安装本文档底部列出的JCE Unlimited Strength下载。如果您使用openjdk JRE,就像Linux上经常使用但并不总是这样,(IME)它不需要这个步骤。。还有一件事是,如何设置客户端选择一个特定的密码,而不是在客户端HELLO中发送一个大列表?由于您使用的是
HttpsUrlConnection
请参阅。对于普通的SSLSocket
来说,答案会更简单。梅塔:我不知道为什么我会收到这条评论的通知,因为你没有使用@,但我使用了。我想是魔法吧。