smartdevicelink / sdl_core

SmartDeviceLink In-Vehicle Software and Sample HMI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PTU failing with WSS cloud app and java_suite app

ShobhitAd opened this issue · comments

Bug Report

Encountering a content length issue on test suite when there is a WSS cloud app added to the preloaded policy table.

The issue seems to be with the certificate parameter, more specifically the \n characters. When core sends the request body, all \ns have an extra escape backslash character(\n) which triggers the content-length promised 19622 bytes, but received 19603 error on the java_suite side.

Reproduction Steps
  1. Add WSS cloud app entry to sdl_preloaded_pt.json
"123e4567-e89b-12d3-a456-426655440000": {
                "keep_context": false,
                "steal_focus": false,
                "priority": "NONE",
                "default_hmi": "NONE",
                "groups": ["Base-4", "CloudAppStore"],
                "RequestType": [],
                "RequestSubType": [],
                "nicknames": ["Test Suite SE"],
                "hybrid_app_preference": "CLOUD",
                "endpoint": "wss://192.168.1.2:4355",
                "auth_token": "None",
                "cloud_transport_type": "WSS",
                "enabled": true,
                "certificate": "-----BEGIN CERTIFICATE-----\nMIIDDzCCAfegAwIBAgIUeLhIGUGdeU4KxJ0UCZ3h5pPtat8wDQYJKoZIhvcNAQEL\nBQAwFzEVMBMGA1UEAwwMMTkyLjE2OC4xLjM0MB4XDTIyMDMxNjE4NTcxOFoXDTIz\nMDMxNjE4NTcxOFowFzEVMBMGA1UEAwwMMTkyLjE2OC4xLjM0MIIBIjANBgkqhkiG\n9w0BAQEFAAOCAQ8AMIIBCgKCAQEAntr/sMoG/BlrdzzhzVw/Pq528HWLRmguNYQe\nfPCqYsL00Uo0faNKsKEiOfbQHKkJGkPteFK+xgNCJA+w3sePgTkMwsyhKNgk2x+R\nI+Aua4hrcq5jaUR+EZ1wZlIS7UIz/y4VVDpiJWq+PfsofAYUvkS3xwOmJIYqnYT2\nTR5NbYW5FugcbH96RymRQ0iI97muijAYEbeQ2VW3f3p8s13Z/onByzcfY3/2LTeo\nZYGNfyLJVunWqzMraw4EwhzoodAjddGngZUwGx/QTAMkL87DGZySCgjvS1CXCpGD\nihzKWVy8L3vCYKA2V+Hjoocm2SiyZp1PQwjNobuErC68B68srQIDAQABo1MwUTAd\nBgNVHQ4EFgQUk5pq1IFzrDGaWhnffA1XOXIDtDQwHwYDVR0jBBgwFoAUk5pq1IFz\nrDGaWhnffA1XOXIDtDQwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOC\nAQEAWNqn/RVZ28kFRCcxQns+stzx6tJiOZs+ILDieXHp1j9xRLJcWNkoOOjeE1eW\nNWTopUzlN7JqRQbvBADM3girQqT3ed8L79C5U02OKeav7Jf7bxV0D/RMVk8pv5rC\nTPnRKdjsJW23P+bSxXPmRkHMIHgwfDxhPQjoCX0PWWjpuf49AXxLJ1U7hE16sQ/1\n03C+tN1hg5dbILinRRyjQ/p8O53/8m62NeFhoT7HomQ7iGPYPERSTcZi9wMkcMjk\n9JYZDyYGkfeIo809Llf94bMLZcTLQ3kGDahNdNwZMY0Zj80c2jV3F0mXXVVdoVBk\nENaXPUOx1QscBAWW1MlOqBz8Yg==\n-----END CERTIFICATE-----\n"
            },
  1. Start policy server and change the 0x07 endpoint in sdl_preloaded_pt.json
  2. Start core and hmi. The WSS app should be in the app list
  3. Register the Test Suite app to trigger a PTU
Expected Behavior

PTU is successful. HMI receives UP_TO_DATE message

Observed Behavior

PTU is unsucessful. Should see the a content-length error on the Test Suite app (in logcat)

2022-04-06 10:03:30.509 24258-24520/io.livio.sdltestsuite.app1 E/PoliciesFetcher: RC_5.4.0: sendSystemRequestToUrl: Could not set request method to post.
    java.net.ProtocolException: content-length promised 19622 bytes, but received 19603
        at com.android.okhttp.internal.http.RetryableSink.close(RetryableSink.java:52)
        at com.android.okhttp.okio.RealBufferedSink.close(RealBufferedSink.java:242)
        at com.android.okhttp.okio.RealBufferedSink$1.close(RealBufferedSink.java:210)
        at java.io.FilterOutputStream.close(FilterOutputStream.java:185)
        at com.smartdevicelink.managers.lifecycle.PoliciesFetcher.fetchPolicies(PoliciesFetcher.java:170)
        at com.smartdevicelink.managers.lifecycle.BaseLifecycleManager$3$1.run(BaseLifecycleManager.java:478)
OS & Version Information
  • OS/Version: Ubuntu 20.04
  • SDL Core Version: develop (65947fd)
  • Testing Against: Test Suite

Closed via #3913