you can configure using mail.<protocol>.class property the exact class you
want as provider -
org.apache.geronimo.javamail.transport.smtp.SMTPSTransport - (it is a
workaround).

btw do you use mail or geronimo-javamail jar?

it would need some debug
in javax.mail.Session#loadProviders(javax.mail.Session.ProviderInfo,
java.io.InputStream) to be sure what's the issue here.

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/8/1 bibhas <[email protected]>

> I tried 1.6 snapshot. Same problem. The core issue is the system resolves
> to
> use "smtp" instead of "smtps" protocol.
>
> DEBUG: getProvider() returning provider protocol=smtp;
> type=javax.mail.Provider$Type@11b5a04;
> class=org.apache.geronimo.javamail.transport.smtp.SMTPTransport;
> vendor=Apache Software Foundation;version=1.0
>
> I changed my code to force the use of smtps.
>
> MimeMessage m = new MimeMessage(mailSession);
> //Setup recipients etc in MimeMessage...
>
> Transport t = mailSession.getTransport("smtps");
> t.connect(mailSession.getProperty("mail.smtps.host"),
> mailSession.getProperty("mail.smtps.user"),
> mailSession.getProperty("mail.smtps.password"));
> t.sendMessage(m, m.getAllRecipients());
>
> Now, the code is failing due to SSL handshake exception:
>
> javax.mail.MessagingException: 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
>
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Not-loading-smtps-resource-properly-tp4664442p4664449.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Reply via email to