Link to home
Start Free TrialLog in
Avatar of pouli
pouli

asked on

HttpUnit & Client Certification

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
Avatar of pouli
pouli

ASKER

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();


ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial