This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Security and the fly likes SSLHandshakeException with keys imported Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "SSLHandshakeException with keys imported" Watch "SSLHandshakeException with keys imported" New topic
Author

SSLHandshakeException with keys imported

Theodore Casser
Ranch Hand

Joined: Mar 14, 2001
Posts: 1902

I'm hoping someone can help me with this - I'm absolutely stumped.

I'm trying to open a connection with a hand-coded client to a web service. The code in question is working fine in my insecure (internet) environment over https/ssl. When I move into the secure (network not connected to the internet) environment, though, it's giving me the handshake exception on the attempt to connect.

I've verified that the appropriate X.509 certificates to connect to the server are in my keystore in the secure environment - it's just frustrating because the code works fine in one environment and not the other, when they're configured (otherwise) similarly. Is there any other reason that it would throw the exception?

The code I use to 'override' the default certs is below. Any help would be welcome.



Theodore Jonathan Casser
SCJP/SCSNI/SCBCD/SCWCD/SCDJWS/SCMAD/SCEA/MCTS/MCPD... and so many more letters than you can shake a stick at!
greg stark
Ranch Hand

Joined: Aug 10, 2006
Posts: 220
what exactly does the exception say? Which JRE is your code using? Is it a Sun or IBM JRE?


Nice to meet you.
Theodore Casser
Ranch Hand

Joined: Mar 14, 2001
Posts: 1902

Actually, we discovered the problem this AM - while the keys were imported into the cacerts keystore we thought the JRE was using, it turns out that the JRE was pointing to different one. Importing the missing key there worked.
 
wood burning stoves
 
subject: SSLHandshakeException with keys imported
 
Similar Threads
"javax.net.ssl.keyStore" system property inside a jar package
Unable to enable SSL communication using GlassFish
how to create java client to access web services running on https/ssl
Problem with SSL Configuration, certificates and keystores
SSL settings for Stand-Alone Java Application in Sun JRE