The error indicates that Java is unable to verify the authenticity and validity of the certificate, which means you are probably using a self-signed cert, which Java (rightfully) doesn’t trust by default. In this case you can manually trust the certificate by adding it to the truststore. The exact steps vary a bit depending on which Java version you use and how you generated the certificate, but in general the whole process is something like described here: https://docs.oracle.com/cd/E54932_01/doc.705/e54936/cssg_create_ssl_cert.htm