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