Hello guys,
i get an SSL issue when trying to send a Mail via Google SMTP Server. I am using the following Mail application settings:
cuba.email.fromAddress = *myMailAddress*
cuba.email.smtpHost = smtp.gmail.com
cuba.email.smtpPort = 465
cuba.email.smtpAuthRequired = true
cuba.email.smtpSslEnabled = true
cuba.email.smtpStarttlsEnable = true
cuba.email.smtpUser = *myMailAddress*
cuba.email.smtpPassword = ********************************
The error when i am e.g. try so send a mail to myself via JMX Console sendTestMail() is the following:
*my mail address* : Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
nested exception is:
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. Failed messages: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
nested exception is:
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
i’ve already imported the smtp.google.de certificate to the java cacerts keystore via OpenSSL and Keytool. When i check for the imported certificate via
.\keytool.exe -list -v -keystore "..\jre\lib\security\cacerts" -alias smtp.gmail.com
it tells me that this certificate exists in the cacerts keystore.
Can someone tell me what i am missing? Is there a environment variable or some kind of start parameter for the tomcat server i have to set, so the tomcat knows where to look for the keystore.
Thanks in advance
Daniel