Fix java.security.cert.CertPathValidatorException when using HTTPS