You need to add the server certificate to Java's keystore, because I'm assuming it's self-signed.
You can get the certificate using
openssl s_client -connect [hostname]:[port e.g. 443] < /dev/null > /tmp/lb.cert
Then add the certificate to your keystore
keytool -importcert -keystore [keystore location, varies, but can be e.g. /etc/pki/java/cacerts] -storepass changeit -file /tmp/lb.cert -alias newSelfSignedKey -noprompt