Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
amba1
Contributor III
Contributor III

Solution: Send mails with Talend - TLS 1.0 and SSLHandshakeException

Hello!

I have seen a lot of people over the internet struggling with the tSendMail component Talend offers and in most cases it's always the same error/java exception.

In this post, I'd like to share the way to fix this general Talend issue with all of you.

Issue/problem

It is not possible to send mails with the tSendMail component provided by Talend. In most cases, the following exception pops up

Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)

The reason is simple

  • tSendMail component is sending mails using the TLS version 1.0
  • TlS 1.0 and TLS 1.1 is disabled by default in JDK 8 or 11

Solution

Before we start playing with the java.security file, here is the real way to solve this issue.

Four steps will be needed.

  1. Update your mail.jar module
    1. Find the correct version here (click)
    2. Once downloaded, add it to your workspace und Talend\Workspace\Project\Libs
  2. The mail 1.4.7.jar needs to be updated in Talend
    1. Go to view > other > modules > search for tSendMail
    2. Click on the 3 dots next to the mail-1.4.jar module
    3. Select your previously installed module File and click on Custom MVN url
      1. The custom url is: mvn:org.talend.libraries/mail-1.4/1.4.7/jar
      2. Click on detect the module install status and then on OK
  3. You now need to eventually add a default property to your job
    1. Go to windows > preferences > Talend > run/Debug > New > add the following argument
      1. -Dmail.smtp.ssl.protocols=TLSv1.2
  4. Make sure you unchecked use specific JVM arguments in all of your jobs.

Here are a few screenshots to help:

  1. 0695b00000L2kHpAAJ.png
  2. 0695b00000L2kI4AAJ.png
  3. 0695b00000L2kGxAAJ.png
  4. 0695b00000L2kIiAAJ.png
  5. 0695b00000L2kG6AAJ.png
Labels (3)
5 Replies
Anonymous
Not applicable

Hello,

It is a very good job and thanks for sharing it with us on community.

Best regards

Sabrina

Raghuram_Puram
Contributor III
Contributor III

Hi @Xiaodi Shi​ 

 

Do we need to publish all the jobs again, after making this change? We have 100's of jobs running.

 

Is there a way to include this argument '-Dmail.smtp.ssl.protocols=TLSv1.2' on the job server(Linux) and all the running jobs in Prod can take it up?

 

Regards,

Raghu

amba1
Contributor III
Contributor III
Author

You can include the argument in your .sh files.

Raghuram_Puram
Contributor III
Contributor III

Could you please help with understanding what are the .sh files and where can I locate them on the jobserver?

amba1
Contributor III
Contributor III
Author

Well, you said that you were hosting the jobs on a Linux machine, right? Each job should have its own shell scripts (.sh) file, in which you can add various parameters.

Since I assume that you did not update your mail.jar component, you have two possibilities for your mails to work.

 

Solution:

Method A

Modifying the file java.security inside the JDK install directory:

  1. Edit the file $JAVA_HOME/conf/security/java.security in a text editor. 
  2. Remove the entries TLSv1, and TLSv1.1, from the following line of that file:
  3. jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES,
  4. Restart the application

On Java 8, the java.security file is located in the following directory: 

$JAVA_HOME/jre/lib/security

Method B

  1. Follow my original post.

 

Keep in mind that Method A is not the right way to do this.

 

Also, you could try just adding this parameter to your .sh file: -Dmail.smtp.ssl.protocols=TLSv1.2

 

If none of the solutions above work, please create a new post with a detailed description of your jobs 🙂