VMSS 500 Status Backend Error - Orchestration couldn't complete

Solved! Go to solution
jtang
Helper

VMSS 500 Status Backend Error - Orchestration couldn't complete

I'm getting this 500 error when POSTing to /vmss/v2/searchTerminatedRequest/: {"responseStatus":{"statusCode":"API003","statusDescription":"Backend Error - Orchestration couldn't complete"}}

My 2-way SSL works since GET /vdp/helloworld/ returns 200.

POST headers:
headers: {
"Content-Type" => "application/json",
"keyId" => "06235331-ef34-45e5-b407-9fa340ab0b48"
}

X-CORRELATION-ID: 1723829614_886_1586319465_-57b9759w5_VDP_WS

Is there any ruby sample code for the MLE process?

6 REPLIES 6
jtang
Helper

Re: VMSS 500 Status Backend Error - Orchestration couldn't complete

 
I used this to get the public key from the cert: 
openssl x509 -in server_cert_06235331-ef34-45e5-b407-9fa340ab0b48.pem -pubkey -noout > vmss_mle_server_public_key.pem
 
Here is what I have in ruby:
JOSE::JWE.block_encrypt(
  JOSE::JWK.from_pem_file("server_public_key.pem"),
  body,
  {
"alg" => "RSA-OAEP-256",
"enc" => "A256GCM",
"kid" => "06235331-ef34-45e5-b407-9fa340ab0b48",
"iat" => (Time.stamp * 1000).round
  }
)
 
unencrypted body (only the required fields with example values from API docs):
{
  "searchTerminatedRequest": {
    "acquirerBID": "10048640",
    "acquirerCountryOrRegion": "JP",
    "globalSearch": false,
    "terminatedRecordSearchCriteria": {
      "address": {
        "city": "St Albans",
        "countryOrRegion": "JP",
        "streetAddress": "80 Wood Street"
      },
      "businessPhoneNumbers": [
        "+861071111222"
      ],
      "category": "1",
      "DBAName": "Snap Photoshop Ltd",
      "principals": [
        {
          "name": "Bill Smith"
        }
      ],
      "tradeOverInternet": false
    }
  }
}
 
encrypted body:
{"encData":"eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIiwiaWF0IjoxNzIzODI3NTA2MjU2LCJraWQiOiIwNjIzNTMzMS1lZjM0LTQ1ZTUtYjQwNy05ZmEzNDBhYjBiNDgifQ.PzHSRdBBl-P8wvW8Uow2aZGdp_tT77WE6qh8mgxvSPrnhAN5DH6MHRCKIAHwu2-x54gcRzGJ74scFcV_Z8Jt5WMlexDwFU_Z3y4vYM30eyIzD9bbZ5gzO7Xgf2jgUJMcc1ZSEA7okC-uO_ZpVJP--zP81nxnPzb5TxwdmyXPxS03rGFCZAPu02vqTLvdacNPM-pGCCf5FX6UqXNuizeJYZ59121Z6MFDwO-HXL2avfKtFF6M4QMjupby4wjoxMeCmyMkauFplwWjUikf-o-1HDYRlMWnBJMzXpCSfEBOB5Z0ZwjdmLIfeVaDqkPSV7QazuwUMWzoZ2q-sYI-oIprLQ.rSFSmUZGwraz4CNK.ilWiDWeL6YZjKjswpXL9uRUgWwjq3OnlqteYiAQun4XMVCmRVgQM_BeG6Ych6k0GjBIi1TTS9-W6sEQSS2Zz4dNHldnLZ_5kU_hwDiTyRb3_mAWZbqWEKUs5w0p2ZX0qxeyPrehqEkGF9_JShbUzsMqgJBU1hZ9AmWbhXq9EvlSreT0ScYMA4EmCp2hDi2nvrIUeeYdbohU9FX_EgZj1h96LAghYC5UWWXeqo192vHogXB8klS0IDH4HfoYqtP6iTlJ9crD4Ls5ZIOFFklZZT_1PKFPr6NZhcx5pwr1o6BS-ZUE6NIVddgkPvK7yefuOjlUzx_8txQtU2qoJUlzPnjQiG3wbG2_G-irm0megbWDzYg_AZocvlDZfdVzHt9qFcbPK5Vx8Q3wSpPX7lVFiubYGjy4SklAk5DvgHx6rMe0IQM3YqlJ_Oqqa5jRjgW2IFlpvp5sDXrf0moYCjZ02eslGJpkV7pZ9ZaoMBFoHT3-VWKcNQ1sG8AXn.-MYFWIU0StZS2PmqjnibqQ"}
jtang
Helper

Re: VMSS 500 Status Backend Error - Orchestration couldn't complete

 
I used this to get the public key from the cert: 
openssl x509 -in server_cert_06235331-ef34-45e5-b407-9fa340ab0b48.pem -pubkey -noout > vmss_mle_server_public_key.pem
 
Here is what I have in ruby:
JOSE::JWE.block_encrypt(
  JOSE::JWK.from_pem_file("server_public_key.pem"),
  # @jwk,
  body,
  {
"alg" => "RSA-OAEP-256",
"enc" => "A256GCM",
"kid" => "06235331-ef34-45e5-b407-9fa340ab0b48",
"iat" => (Time.stamp * 1000).round
  }
)
 
unencrypted body (only the required fields with example values from API docs):
{
  "searchTerminatedRequest": {
    "acquirerBID": "10048640",
    "acquirerCountryOrRegion": "JP",
    "globalSearch": false,
    "terminatedRecordSearchCriteria": {
      "address": {
        "city": "St Albans",
        "countryOrRegion": "JP",
        "streetAddress": "80 Wood Street"
      },
      "businessPhoneNumbers": [
        "+861071111222"
      ],
      "category": "1",
      "DBAName": "Snap Photoshop Ltd",
      "principals": [
        {
          "name": "Bill Smith"
        }
      ],
      "tradeOverInternet": false
    }
  }
}
jtang
Helper

Re: VMSS 500 Status Backend Error - Orchestration couldn't complete

encrypted body (what I put as the body in the POST):
{"encData":"eyJhbGciOiJSU.......mqjnibqQ"}

SyedSa
Community Moderator

Re: VMSS 500 Status Backend Error - Orchestration couldn't complete

Hi @jtang, Thank you for reaching out. An agent will get back to you soon. Until then, if any community member has information that may be helpful, feel free to reply to this thread.

jtang
Helper

Re: VMSS 500 Status Backend Error - Orchestration couldn't complete

Working ruby solution. Get the public key the same way I did above.

 

Turns out A256GCM doesn't work so just use A128GCM. Also 'Accept' is a necessary header.

 

Feel free to close this ticket.

 

 

require "jose"
encryption_key = 'vmss_mle_server_public_key.pem'
decryption_key = 'vmss_mle_client_private_key.pem'
enc_jwk = JOSE::JWK.from_pem(File.read(encryption_key))
dec_jwk = JOSE::JWK.from_pem(File.read(decryption_key))
 
body = '{"searchTerminatedRequest": {"acquirerBID": "10048640", "acquirerCountryOrRegion": "JP", "globalSearch": false, "terminatedRecordSearchCriteria": {"address": {"city": "St Albans", "countryOrRegion": "TH", "streetAddress": "80 Wood Street"}, "businessPhoneNumbers": ["+861071111222"], "category": "1", "DBAName": "Snap Photoshop Ltd", "principals": [{"name": "Bill Smith"}], "tradeOverInternet": false}}}'
payload = JOSE::JWE.block_encrypt(
  enc_jwk,
  body,
  {
"alg" => "RSA-OAEP-256",
"enc" => "A128GCM",
"kid" => "a3b3e0e0-423b-4259-ba60-660631587b06",
  }
).compact
 
body = "{\"encData\":\"#{payload}\"}"
payload = JSON.parse(body)['encData']
jenn_kh
Community Moderator

Re: VMSS 500 Status Backend Error - Orchestration couldn't complete

Thank you for updating the community with your solution, @jtang!