Question

javax.mail.MessagingException: Could not convert socket to TLS;

Hi,

System generates sporadically error when send email through scheduler.

Log

ERROR - Unexpected exception caught while trying to send an email message with sender ID of XXXXXXXXXXX

javax.mail.MessagingException: Could not convert socket to TLS;
nested exception is:
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:2046)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:711)
at javax.mail.Service.connect(Service.java:366)
at javax.mail.Service.connect(Service.java:246)
at com.pegarules.generated.SendEmailMessage_071025_BlRMk6UdYGJBle4Q9qA_kg.SendEmailMessage07_10_25(SendEmailMessage_071025_BlRMk6UdYGJBle4Q9qA_kg.java:362)
at com.pegarules.generated.SendEmailMessage_071025_BlRMk6UdYGJBle4Q9qA_kg.invoke(SendEmailMessage_071025_BlRMk6UdYGJBle4Q9qA_kg.java:90)
at com.pega.pegarules.generation.internal.library.LibraryRuntime.resolveAndinvokeFunctionViaReflection(LibraryRuntime.java:221)
at com.pega.pegarules.generation.internal.library.LibraryRuntime.invokeLibraryRuntime(LibraryRuntime.java:119)
at com.pega.pegarules.session.internal.mgmt.Executable.invokeLibraryRuntime(Executable.java:9073)
at com.pega.pegarules.priv.generator.LibrarySupport.resolveAndInvokeFunctionViaReflectionWithException(LibrarySupport.java:275)
at java.lang.invoke.DirectHandle.invokeExact_thunkArchetype_L(DirectHandle.java:235)
at java.lang.invoke.BruteArgumentMoverHandle.invokeExact_thunkArchetype_X(ArgumentMoverHandle.java:390)
at java.lang.invoke.CollectHandle.invokeExact_thunkArchetype_X(CollectHandle.java:99)
at java.lang.invoke.FilterReturnHandle.invokeExact_thunkArchetype_X(FilterReturnHandle.java:42)
at java.lang.invoke.AsTypeHandle.invokeExact_thunkArchetype_X(AsTypeHandle.java:34)
at com.pegarules.generated.activity.ra_action_sendemailnotification_71749bf75123085c922415ea17ed816b$$dtt.dt_62_step6_circum0_357(Unknown Source)
at com.pegarules.generated.activity.ra_action_sendemailnotification_71749bf75123085c922415ea17ed816b.step6_circum0(ra_action_sendemailnotification_71749bf75123085c922415ea17ed816b.java)

Correct Answer
November 12, 2018 - 11:21pm

Try bypassing TLS by setting/creating DSS  in your environment

Owning Ruleset = Pega-IntSvcs  Purpose = Email/DisableSecuritySTARTTLS  Value = true

-Thanks

  Anupam

Comments

Keep up to date on this post and subscribe to comments

Pega
December 26, 2017 - 9:15am

From the log we could see SSLHandshakeException: Remote host closed connection during handshake. This means that there is some network issue. That is why you face this issue sporadically.

You can get more information on the following:

https://pdn.pega.com/pegatube/techtalk-episode-25-resolving-common-problems-email-listeners

https://pdn.pega.com/troubleshooting-common-email-issues/troubleshooting-common-email-issues

December 26, 2017 - 10:40am

 

Can you provide the below details.

App server and version
Java version
Email Account record information... at least:
What host are they connecting to? Exchange / Gmail / etc
what port are they using?
Is the listener running frequently?
Is the listener running on more than one server/node?
Is the email provider  using load balancing?

Can you also check JRE version used by app server and JRE version which email listener is using.

December 26, 2017 - 12:30pm

Log says connectivity issue between Pega server and email server. If your using exchange server then register Pega server ipaddress in email server.

December 26, 2017 - 3:54pm

From the stacktrace looks like a JRE mismatch from the outset .

However add following JVM argument -Djavax.net.debug=ssl which will log all SSL related interaction over the network  in the server logs  .

Thanks,

Arun

Pega
November 12, 2018 - 11:21pm

Try bypassing TLS by setting/creating DSS  in your environment

Owning Ruleset = Pega-IntSvcs  Purpose = Email/DisableSecuritySTARTTLS  Value = true

-Thanks

  Anupam

August 28, 2019 - 6:31am
Response to hyana1

Thanks Anupam.. Worked for me

Pega
March 7, 2019 - 8:03am

Anupam,

Awesome, your suggestion fixed it for me. Thanks!

Marco.

August 28, 2019 - 11:11am

Thanks @Dhivya2b20 & @Marco Looy for letting us know that @hyana1's reply was the correct answer!

I have marked it as such to let others know who may be having the same question.

Marissa | Community Moderator | Pegasystems Inc.