2
我设置了客户端密钥库和信任在Apache Wink客户端如何配置Apache Wink客户端密钥库和信任
我无法找到如何做的文档怎么办。
http://wink.apache.org/documentation/1.2.1/Apache_Wink_User_Guide.pdf
我设置了客户端密钥库和信任在Apache Wink客户端如何配置Apache Wink客户端密钥库和信任
我无法找到如何做的文档怎么办。
http://wink.apache.org/documentation/1.2.1/Apache_Wink_User_Guide.pdf
我认为 “正常” 的代码初始化SSLContext
将工作。
示例如何加载信任:
String path = ....
char[] password = ....
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
keyStore.load(new FileInputStream(path), password);
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
tmf.init(keyStore);
SSLContext ctx = SSLContext.getInstance("SSL");
ctx.init(null, tmf.getTrustManagers(), null);
如果您还需要客户端证书密钥库,以类似的方式使用KeyStoreFactory或实施KeyManager
难道我不需要添加密钥库和TrustStore到ClientConfig,比如Jersey客户端? // import com.sun.jersey.api.client.config.ClientConfig; // import com.sun.jersey.api.client.config.DefaultClientConfig; ClientConfig config = new DefaultClientConfig(); (),HTTPSProperties.PROPERTY_HTTPS_PROPERTIES,new HTTPSProperties(getHostnameVerifier(),getSSLContext()));这个方法可以用来创建一个新的HTTPSProperties对象。 – DarVar
据我记得,默认使用HttpsURLConnection,这意味着将使用默认的SSLContext。 – Tarlog
您可以配置到眨眼使用Apache HTTP客户端,在这种情况下,你需要SSL配置传递到客户端 – Tarlog