Solved

HttpUnit & Client Certification

Posted on 2004-04-29
2
529 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
eclipse apache tomcat admin console 52 147
ejb wildfly example 2 69
running on tomcat not jboss eap 7.0 3 28
Java 8 to Java 6 8 32
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

679 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