Skip to content

MLE Decryption Failing #159

Description

@coleyb

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions