我想以編程方式訪問需要客戶端證書的站點,我在PEM文件中有這些證書。在這個應用程序中,如果我可以避免這樣做,我不想將它們添加到我的密鑰庫中,請使用keytool或openssl。我需要用代碼直接處理它們。Apache HttpClient和PEM證書文件
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet("https://my.secure.site.com/url");
// TODO: Specify ca.pem and client.pem here?
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
if (entity != null) {
entity.consumeContent();
}
httpclient.getConnectionManager().shutdown();
我怎麼會「發送」與請求證書?
或者是有其他格式的文件(除了PEM),這將使這更容易實現? – 2010-11-10 18:26:10