• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Need to implement persistent SSL in java

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.setRequestMethod("POST");
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());
con.setDoInput(true);
con.setDoOutput(true);
con.setUseCaches(false);
con.connect();
===========================================
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.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
reply
    Bookmark Topic Watch Topic
  • New Topic