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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The "wc.setHeaderField()"
// ssl (https) proxy information
System.getProperties().put
System.getProperties().put
"www-proxy.company.com");
System.getProperties().put
// 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();