So I'm trying to send a code to my email with Java. I started out with javax.mail but remember I had problems with it last time I used it so I moved on to Apache Commons Mail.
I'm getting a bunch of errors though. On SSL, I'm getting a java.net.SocketTimeoutException
and on TLS, I'm getting a handful of errors:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:2000)
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
When I did a quick Google search, I found this question. Now because I'm a complete idiot, I do not understand the answer.
What can I do to resolve the errors? Whether it be preventing the Timeout on SSL or the others on TLS.
EDIT: I do not have a problem sending emails and MessageException
is NOT my problem so please stop answering with that.