While verifying Message Level Encryption (MLE) integration using this SDK together with the official sample repo cybersource-rest-samples-java, I encountered a Connection reset exception only when MLE response encryption is enabled.
The same sample works fine when:
MLE is enabled for request only, or
MLE is disabled entirely.
Enabling both request and response MLE consistently results in a socket connection reset during the payment API (pts/v2/payments) call.
SDK: This repository (latest which is version 0.087 at this moment)
Samples repo: https://github.com/CyberSource/cybersource-rest-samples-java (latest that uses this SDK ver 0.087)
Sample used: samples/MLEFeature/PaymentsWithMLE.java
Java version: Java 8
OS: Linux
Clone the sample repository:
git clone https://github.com/CyberSource/cybersource-rest-samples-java
Open the sample:
samples/MLEFeature/PaymentsWithMLE.java
Modify the merchant configuration to enable request and response MLE:
Change (around line #84):
merchantProp = ConfigurationWithMLE.getMerchantDetailsWithMLE1();
To:
merchantProp = ConfigurationWithMLE.getMerchantDetailsWithRequestAndResponseMLE1();
Run:
PaymentsWithMLE.java
The payment request should complete successfully when MLE response encryption is enabled, just as it does when only request MLE is enabled.
The request fails with a Connection reset error:
Invokers.ApiException: java.net.SocketException: Connection reset at Invokers.ApiClient.execute(ApiClient.java:1117) at Api.PaymentsApi.createPaymentWithHttpInfo(PaymentsApi.java:348) at Api.PaymentsApi.createPayment(PaymentsApi.java:331) at samples.MLEFeature.PaymentsWithMLE.run(PaymentsWithMLE.java:90) at samples.MLEFeature.PaymentsWithMLE.main(PaymentsWithMLE.java:34) Caused by: java.net.SocketException: Connection reset at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:318) at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:346)
The failure happens only when response MLE is enabled.
The same credentials and configuration work correctly when response MLE is disabled.
This appears to occur before a valid HTTP response is received (connection reset at socket level).
Is response MLE currently supported for the Payments API in this SDK?
Are there additional configuration steps required for enabling response MLE?
Is this a known issue or regression?
04-02-2026 04:30 PM