Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need to implement persistent SSL in java  RSS feed

Ice T.
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to send data from a client app to a IIS webserver. I have set in my code all the necessary stuff needed for persistent ssL, but the socket still closes. I have used both jdk1.3 and jdk1.4 but to no avail. Here's a sample of my code :
HttpURLConnection con = (HttpURLConnection)new URL(urlAddress).openConnection();
con.setRequestProperty ("Authorization", "Basic " + encoding);
con.setRequestProperty("HTTP-Version", "HTTP/1.1");
con.setRequestProperty ("Content-Type", "application/xml");
con.setRequestProperty ("Connection", "Keep-Alive");
con.setRequestProperty("Proxy-Connection", "Keep-Alive");
con.setRequestProperty ("Content-Length", ""+xmlStr.length());
After that, I open a outputstream, then I write an xml to that url, then I close the stream, and open a reader stream to read the reply. That's basically it.
I did a check on the netstat log, and find out the socket always closes, and its initiated by my app not the IIS webserver.
Can anybody help? Thanks in advance.
Ernest Friedman-Hill
author and iconoclast
Posts: 24217
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mr. T,
Welcome to JavaRanch!
We don't have too many rules round these parts, but we do have our naming policy, which requires that your display name not be an obviously fictitious name (even if you were the famous entertainer, his name is obviously fictitious, so we wouldn't let him use it either!) Pleae head over here and update yours, pronto. Thanks, pardner!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!