Edit :- Tried to format the question and accepted answer in more presentable way at mine Blog
Here is the original issue.
Using Tomcat 7 under Linux, this did the trick.
String certificatesTrustStorePath = "/etc/alternatives/jre/lib/security/cacerts";
System.setProperty("javax.net.ssl.trustStore", certificatesTrustStorePath);
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
Under Linux, $JAVA_HOME
is not always setup, but usually /etc/alternatives/jre
points to $JAVA_HOME/jre