Hi all,

We have the need to connect to a server and authenticate using client certificates, then stream an xml request out to it. I can do the client cert stuff, but can streaming out the xml be done with HttpClient? Our current code (without client cert support) is below.

The other method i've tried is just using a plain HttpsUrlConnection, but getting it to send the client cert is proving to be tricky. I've registered the DefaultSSLSocketFactory, but for some reason it won't present my client cert :(

Any thoughts appreciated.

Thanks

Tim

URL urlObj = new URL(url);
HttpURLConnection.setFollowRedirects(true);
HttpURLConnection connection = (HttpURLConnection)urlObj.openConnection();
connection.setRequestMethod("POST");
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setInstanceFollowRedirects(true);
OutputStream os = connection.getOutputStream();
PrintWriter writer = new PrintWriter(os, true);
writer.println(message);
os.close();
InputStream is = connection.getInputStream();
Reader reader = Util.convertInputStreamToReader(is);


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to