Open hhallenyang opened 10 months ago
This is probably because in GlassFish 7 you don’t have the certificate from smtp.google.com in the trust store file cacerts.jks. You need to download it and add it there. Or copy it from the same file in GlassFish 4, where you probably installed it in the past.
The Glassfish Server generate an exception when the system try to send email out.
Environment Details
Problem Description
I got the "Could not convert socket to TLS" exception when I try to send an email out. I could send it out successfully with the same code and configuration from Glassfish 4 installed in the same computer.
This problem is easily reproducible.
expected resource not found: /META-INF/javamail.default.address.map|#] jakarta.mail.MessagingException: Could not convert socket to TLS; nested exception is: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target|#]
Steps to reproduce
Start the Glassfish server, configure the email connection, enter the email content and send the email out.
The same method as shown below is called from Glassfish 4 and Glassfish 7. Glassfish 4 sent the email successfully but Glassfish 7 got the exception above.
Glassfish 4: Java EE Web API Library Glassfish 7: includes
Impact of Issue
Sending email is very important for the project.
High