Don't use a stubbed out TrustManager as this makes your application trust everyone. I would recommend downloading the certificate presented by the site and adding it to a private, trusted keystore. This lets you make an exception for that one site without greenlighting everyone.
I also like this approach because it requires no code changes.
In Chrome, click the lock icon to the left of the url. Then click "Certificate Information". Go to the "Details" tab and click "Copy to file". Save it as a "base64 encoded X.509 (.cer)" to "SITENAME.cer".
Copy $JAVA_HOME/lib/security/cacerts to your application's directory as "mykeystore.jks".
Install the certificate with:
keytool -keystore mykeystore.jks -storepass changeit -importcert -alias SITENAME -trustcacerts -file SITE.cer
Now, when you run your application, tell it to use the private certificate store:
java -Djavax.net.ssl.trustStore=mykeystore.jks ...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…