Sending Email through an SMTP Server via SSL Fails Due to Resource Configuration

Symptoms

When sending a test email via an SSL connection (configured as a JNDI resource), mail won't be sent and the following error message is displayed:

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

Cause

The issue is caused due to the inclusion of mail.smtp.socketFactory.class property in the JNDI definition:

<Resource name="mail/SmtpServer"    
    auth="Container" 
    type="javax.mail.Session" 
    mail.smtp.host="mail.mycompany.com" 
    mail.smtp.port="587" 
    mail.smtp.auth="true" 
    mail.smtp.user="jira@mycompany.com" 
    password="mypassword" 
    mail.smtp.starttls.enable="true" 
    mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
/>

Resolution

Remove the mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory" line in conf/server.xml and restart JIRA.

   

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport