CyberSource / CyberSource/cybersource-rest-client-ruby

MLE Decryption Failing

Open
#159 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
7
Forks
53
Avg merge
30m
Merged PRs (30d)
1

Description

I'll first start by saying I am not sure if this on the CyberSource Test API side or this gem. I reached out to their support but it's getting no where. We recently ran into an issue where MLE decryption stopped working when no changes or deployments were made on our side. We are on version 0.0.82 of this gem. We are hitting apitest.cybersource.com and attempting to call.

      payment_instance = CyberSource::PaymentsApi.new(api_client, config)

      response, status_code = payment_instance.create_payment(request_obj)

The error returned is CyberSource::ApiError Exception: Failure when receiving data from the peer. It works fine when enableResponseMleGlobally is set to false. We already tried swapping out our certs to no avail.

Any help would be appreciated! Below is our log output as well:

[2026-03-11 11:11:57] INFO   (MerchantConfig): START> =======================================
[2026-03-11 11:11:57] INFO   (MerchantConfig): Entered value for Key File Path : /path/to/resource/StagingCybersourceRequestMLE.p12
[2026-03-11 11:11:57] INFO   (MerchantConfig): Merchant Configuration:
{
  "runEnvironment"                           => "apitest.cybersource.com",
  "timeout"                                  => 10000,
  "authenticationType"                       => "JWT",
  "jsonFilePath"                             => "/path/to/resource/request.json",
  "keysDirectory"                            => "/path/to/resource",
  "keyFilename"                              => "StagingCybersourceRequestMLE",
  "logConfiguration"                         => {
    "enableLog"     => true,
    "loggingLevel"  => "DEBUG",
    "logDirectory"  => "log",
    "logFilename"   => "cybs",
    "maxLogSize"    => 10485760,
    "maxLogFiles"   => 5,
    "enableMasking" => true
  },
  "enableRequestMLEForOptionalApisGlobally"  => true,
  "requestMleKeyAlias"                       => "CyberSource_SJC_US",
  "enableResponseMleGlobally"                => true,
  "responseMlePrivateKeyFilePath"            => "/path/to/resource/StagingCybersourceResponseMLE.p12",
  "responseMlePrivateKeyFilePassword"        => "[REDACTED]",
  "responseMleKID"                           => "[REDACTED]"
}

[2026-03-11 11:12:04] INFO   (MLEUtility): Encrypting request payload
[2026-03-11 11:12:04] DEBUG  (MLEUtility): LOG_REQUEST_BEFORE_MLE:
{
  "clientReferenceInformation": {
    "code": "[REDACTED]",
    "partner": { "developerId": "[REDACTED]" }
  },
  "processingInformation": {
    "capture": true,
    "commerceIndicator": "internet"
  },
  "paymentInformation": {
    "customer": { "id": "[REDACTED]" }
  },
  "orderInformation": {
    "amountDetails": {
      "totalAmount": "5.17",
      "currency": "USD"
    }
  }
}
[2026-03-11 11:12:04] DEBUG  (MLEUtility): LOG_REQUEST_AFTER_MLE: { "encryptedRequest": "[ENCRYPTED_PAYLOAD]" }
[2026-03-11 11:12:04] INFO   (Authorization): Authentication Type: JWT
[2026-03-11 11:12:04] DEBUG  (MLEUtility): Validating responseMleKID for JWT token generation
[2026-03-11 11:12:04] DEBUG  (MLEUtility): P12/PFX file detected, checking if it is a CyberSource certificate
[2026-03-11 11:12:04] DEBUG  (MLEUtility): Successfully auto-extracted responseMleKID from CyberSource P12 certificate

[2026-03-11 11:16:05] INFO   (MLEUtility): Encrypting request payload
[2026-03-11 11:16:05] DEBUG  (MLEUtility): LOG_REQUEST_BEFORE_MLE:
{
  "clientReferenceInformation": {
    "code": "[REDACTED]",
    "partner": { "developerId": "[REDACTED]" }
  },
  "processingInformation": {
    "capture": true,
    "commerceIndicator": "internet"
  },
  "paymentInformation": {
    "customer": { "id": "[REDACTED]" }
  },
  "orderInformation": {
    "amountDetails": {
      "totalAmount": "5.17",
      "currency": "USD"
    }
  }
}
[2026-03-11 11:16:05] DEBUG  (MLEUtility): LOG_REQUEST_AFTER_MLE: { "encryptedRequest": "[ENCRYPTED_PAYLOAD]" }
[2026-03-11 11:16:05] INFO   (Authorization): Authentication Type: JWT
[2026-03-11 11:16:05] DEBUG  (MLEUtility): Validating responseMleKID for JWT token generation
[2026-03-11 11:16:05] DEBUG  (MLEUtility): P12/PFX file detected, checking if it is a CyberSource certificate
[2026-03-11 11:16:05] DEBUG  (MLEUtility): Successfully auto-extracted responseMleKID from CyberSource P12 certificate

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with CyberSource::PaymentsApi#create_payment and the configuration for enableResponseMleGlobally, responseMlePrivateKeyFilePath, and responseMleKID. Reproduce the failure against apitest.cybersource.com with response MLE enabled, then compare it with the working disabled case. Done means identifying whether the client or CyberSource test API causes the peer failure and documenting or testing the confirmed fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api, payments
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.