• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question about HttpsURLConnection

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

I am running a struts application on jboss 3.2.1. Part of my application deals with posting xml over https. Two problems popped up today, and because they appeared at the same time, I have a hunch they're related.

1. Our production server (which we recently purchased a new SSL certificate for) cannot post xml over https.
2. All of our testing servers can post xml over https (these are running the exact same code). However, when we try to post to our production server, the code breaks.

Here is the code that does the posting:



While using Eclipse's debugger to step through this code on my local machine to QA problem #2, everything goes fine until the line header = uc.getHeaderField(j); No exception is thrown that I can see, but the system hangs, and the debugger stops working. I thought maybe some kind of exception was being thrown (hence the try/catch) but nothing is caught.

Any ideas what might be the problem? Does this sound like an issue with the cert? It was purchased two weeks ago or so, and is valid from 7/21/2005 to 8/11/2006.

Any help would be greatly appreciated. Thank you,


Ben Rainville
 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your application does something like
struts webapp -> https post -> production server?

Where the struts webapp doesn't live on the production server?

Anyway, does j have a value when it hangs? - presumably 0

The javadocs for getHeaderField() implies it's working with the headers from the HTTP Response. The fact that getHeaderField(0) hangs, suggests that, it probably is something to do with the certificate.

Have you had the println from your custom HostnameVerifier code, if you haven't, this implies that you haven't made a connection to your production server.

That's not much help yet... Perhaps,
a) Check the productions servers certificate for CRL distribution points / OCSP distribution points. Are you set up to automatically try and access these things ? - in which case check you have access to them...
b) Import your production servers cert into your local application's trusted keystore.

Lewin
 
Ben Rainville
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, the struts app does live on the production server, but there is a mirror of the application on another server. The struts app sends and receives xml, and in this case, the mirror was sending and the production server was receiving.

After I posted, I thought that maybe the keystore was the problem, so I reimported the production certificate, but to no avail. Then I had our IT guy restart the linux box that hosts the production app, and now everything works fine.

Weird. Thanks for your help though.
 
She'll be back. I'm just gonna wait here. With this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic