IBM Support

B2B Mail Client Adapter in Sterling B2B Integrator is failing with javax.mail.MessagingException: Remote host closed connection during handshake;

Troubleshooting


Problem

The B2B Mail Client adapter in Sterling B2B Integrator (SBI) is failing with javax.mail.MessagingException: Remote host closed connection during handshake.

Symptom

The certificate configured in the B2B Mail Client adapter is a CA generated certificate and it is chained and verified per the configuration.
The b2bmailclient.log reports:

[2021-08-25 01:31:34.756] DEBUG SSLSocketControl, unlocked
[2021-08-25 01:31:34.835] ERROR AccessMailJ, get folder exception =
[2021-08-25 01:31:34.835] ERROR [1629855094835] Remote host closed connection during handshake
[2021-08-25 01:31:34.835] ERRORDTL [1629855094835]javax.mail.MessagingException: Remote host closed connection during handshake;
  nested exception is:
    javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:742)
    at javax.mail.Service.connect(Service.java:366)
    at com.sterlingcommerce.woodstock.services.b2bmailsvs.AccessMailJ.connect(AccessMailJ.java:324)
    at com.sterlingcommerce.woodstock.services.b2bmailsvs.SimpleMailClient.processData(SimpleMailClient.java:121)
    at com.sterlingcommerce.woodstock.workflow.activity.engine.ActivityEngineHelper.invokeService(ActivityEngineHelper.java:1826)
    at com.sterlingcommerce.woodstock.workflow.activity.engine.ActivityEngineHelper.nextMainLogic(ActivityEngineHelper.java:631)
    at com.sterlingcommerce.woodstock.workflow.activity.engine.ActivityEngineHelper.next(ActivityEngineHelper.java:362)
    at com.sterlingcommerce.woodstock.workflow.queue.WorkFlowQueueListener.doWork(WorkFlowQueueListener.java:459)
    at com.sterlingcommerce.woodstock.workflow.queue.WorkFlowQueueListener.run(WorkFlowQueueListener.java:240)
    at com.sterlingcommerce.woodstock.workflow.queue.WorkFlowQueueListener.onMessage(WorkFlowQueueListener.java:197)
    at com.sterlingcommerce.woodstock.workflow.queue.WorkFlowQueueListener.onMessage(WorkFlowQueueListener.java:184)
    at com.sterlingcommerce.woodstock.workflow.queue.wfTransporter.run(wfTransporter.java:447)
    at com.sterlingcommerce.woodstock.workflow.queue.BasicExecutor$Worker.run(BasicExecutor.java:529)
    at java.lang.Thread.run(Thread.java:811)
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    at com.ibm.jsse2.av.a(av.java:599)
    at com.ibm.jsse2.av.i(av.java:869)
    at com.ibm.jsse2.av.a(av.java:19)
    at com.ibm.jsse2.av.startHandshake(av.java:672)
    at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:626)
    at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:400)
    at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:217)
    at com.sun.mail.iap.Protocol.<init>(Protocol.java:134)
    at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:131)
    at com.sun.mail.imap.IMAPStore.newIMAPProtocol(IMAPStore.java:763)
    at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:698)
    ... 13 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
    at com.ibm.jsse2.b.a(b.java:131)
    at com.ibm.jsse2.av.a(av.java:562)
... 23 more

The pcap (network trace taken while the issue occurred) shows that the client hello step is trying to use TLSv1.0 - but the remote mail server is set to only use TLSv1.2

customer_overrides.properties had:

Security.SSLHelloProtocol=TLS1.2-ONLY

The S in security should be lower case and if the intention is to use TLS1.2 only, then the override to add to customer_overrides.properties is:

security.SSLHelloProtocol=TLS1.2

The override is based on the documentation in the security.properties:

# A set of valid useful property values for SSLHelloProtocol are as follows

# TLS1-TLS1.1 for TLS1.0 and TLS1.1

# TLS1-TLS1.2 for TLS1.0, TLS1.1 and TLS1.2

# TLS1.1-TLS1.2 for TLS1.1 and TLS1.2

# TLS1 for TLS1.0 only

# TLS1.1 for TLS1.1 only

# TLS1.2 for TLS1.2 only

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS3JSW","label":"IBM Sterling B2B Integrator"},"ARM Category":[{"code":"a8m0z000000bqg8AAA","label":"Protocol-\u003EB2BMailClient"},{"code":"a8m0z0000001iLLAAY","label":"Protocol-\u003ESSL\/TLS"}],"ARM Case Number":"TS006563479","Platform":[{"code":"PF033","label":"Windows"}],"Version":"6.0.1"}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
31 August 2021

UID

ibm16485277