Solved

HttpUnit & Client Certification

Posted on 2004-04-29
2
511 Views
Last Modified: 2009-12-16
Hello, it seems that today I will spent all my points :)

Friends here is my problem now.
I need to emulate the browser that has a certification.
At the begining I tought I will use a Java program and enter to the Http Hreaders with the name
X-Client-Cert the certification,
enter the username/password with the setRequestProperty
and finally open a connection to the server
and check the answer.

After a while I found the HttpUnit makes exactly this, emulating the browser, perfect I tought do not reinvent the wheel I will use this.

But I cannot find how I will insert into the headers my certification.

Any ideas ???

Thank you in advance
pouli is ready to fly
0
Comment
Question by:pouli
2 Comments
 

Author Comment

by:pouli
ID: 10956686
It seems that I have found something from the mailing list of the HttpUnit

The "wc.setHeaderField()"

       // ssl (https) proxy information
       System.getProperties().put("https.proxySet", "true");
       System.getProperties().put("https.proxyHost",
"www-proxy.company.com");
       System.getProperties().put("https.proxyPort", "80");

       // http proxy information
       wc = new WebConversation();
       wc.setProxyServer( "www-ad-proxy.sabre.com", 80 );
       String password = "user.name:passw0rd";
       String base64Password = "Basic " + Base64.encode(password);
       wc.setHeaderField( "Proxy-Authorization", base64Password );
       ClientProperties cp = wc.getClientProperties();


0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 10957419
PAQ'd and points refunded.

modulo
CS Moderator
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now