Friday, January 20, 2023

Your java application unable to send the email after deploy in tomcat9 webserver

 

Issue
===========
Title - server is not sending the email through your appliation
Descrp - sometimes the tomcat server installed in linux system is not able to send the email throgh your deployed webapplication
even if you tested in local windows machine
Solution
===========
soource - https://serverfault.com/questions/1062435/cannot-send-emails-from-tomcat-application
The problem was with the last versions of Java.
I had installed openjdk 1.8.0_292, since _291, doesn't allow TLS 1.0 and 1.1, protocol that Gmail has by default until today.
So, to be able to solve my problem without install another versions of java, I had edited the file /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security
And commented that part:
#jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
#DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
#include jdk.disabled.namedCurves
And add this part right after:
jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, \
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
include jdk.disabled.namedCurves1
As you can see, the java had explicity disabled some protocols, returning the COULD NOT CONVERT SOCKET TO TLS error.
Hope this help others who may find that problem.

No comments:

Post a Comment

Easy way to completely uninstall python

The process is only for Windows OS  1) run the following command from cmd pip list   // list out the all the package pip freeze > require...