1 package com.freemindcafe.https.clientauth;
3 import java.io.IOException;
5 import javax.net.ssl.SSLSocketFactory;
8 import org.
apache.commons.httpclient.HttpClient;
9 import org.
apache.commons.httpclient.HttpException;
11 import org.
apache.commons.httpclient.methods.GetMethod;
18 System.setProperty(
"javax.net.ssl.trustStore", currentDir()+
"/src/com/freemindcafe/https/clientauth/clientkeystore.jks");
19 System.setProperty(
"javax.net.ssl.trustStorePassword",
"password");
20 System.setProperty(
"javax.net.ssl.keyStore", currentDir()+
"/src/com/freemindcafe/https/clientauth/clientkeystore.jks");
21 System.setProperty(
"javax.net.ssl.keyStorePassword",
"password");
22 System.setProperty(
"javax.net.debug",
"ssl:handshake");
25 public static void main(String[] args)
throws HttpException, IOException
27 HttpClient client =
new HttpClient();
28 GetMethod method =
new GetMethod();
30 method.setURI(
new URI(
"https://localhost:443",
false));
32 client.executeMethod(method);
33 System.out.println(method.getResponseBodyAsString());