This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C129EKCPDT: HTTPS Post giving a error 400

Part Number: TM4C129EKCPDT
Other Parts Discussed in Thread: SYSBIOS,

Hello,

I am trying to post to https://postman-echo.com  with reference to code I found in Ti forums. I am getting an error 400 on calling HTTPCli_getResponseStatus(&cli); after a successful post using HTTPCli_sendRequestBody(). Does anyone have previous experience with this? Appreciate your help. Below is my code for your reference.

Thanks.

TI-RTOS for TivaC 2.16.01.14,

XDCtools v 3.32.0.06_core 

WolfSSl ver: 3.9.10-stable

/***********HTTPS communication code******************************/

HTTPCli_Params params;
HTTPCli_Struct cli;
HTTPCli_Field fields[3] = {
{ HTTPStd_FIELD_NAME_HOST, HOSTNAME },
{ HTTPStd_FIELD_NAME_CONTENT_TYPE, CONTENT_TYPE },
{ NULL, NULL }
};

// Response field filters
char respFields[2] = {
NULL
};

startNTP();

System_printf("Sending a HTTPS POST request to '%s'\n", HOSTNAME);
System_flush();

TLS_Params_init(&tlsParams);
tlsParams.ca = ca;
tlsParams.calen = calen;

tls = TLS_create(TLS_METHOD_CLIENT_TLSV1_2, &tlsParams, NULL);
if (!tls) {
printError("httpsTask: TLS create failed", -1);
}

HTTPCli_construct(&cli);

HTTPCli_setRequestFields(&cli, fields);

HTTPCli_setResponseFields(&cli, respFields);

ret = HTTPCli_initSockAddr((struct sockaddr *)&addr, "">https://postman-echo.com/POST", 0);
if (ret < 0) {
printError("httpsTask: address resolution failed\n", ret);
}

params.tls = tls;
HTTPCli_Params_init(&params);


ret = HTTPCli_connect(&cli, (struct sockaddr *)&addr, HTTPCli_TYPE_TLS, &params);
if (ret < 0) {
printError("httpsTask: connect failed\n", ret);
}


ret = HTTPCli_sendRequest(&cli, HTTPStd_POST, REQUEST_URI, true);
if (ret < 0) {
printError("httpsTask: send failed\n", ret);
}
else
{
System_printf("sendRequest successful\n");
}


ret = HTTPCli_sendField(&cli, HTTPStd_FIELD_NAME_CONTENT_LENGTH, CONTENT_LENGTH, false);
ret = HTTPCli_sendField(&cli, HTTPStd_FIELD_NAME_CONTENT_TYPE, CONTENT_TYPE, true);

if (ret < 0) {
printError("httpTask: send failed\n", ret);
}
else {
System_printf("sendField successful\n");
}
ret = HTTPCli_sendRequestBody(&cli, data, strlen(data));
if (ret < 0) {
printError("httpTask: Variable data couldn't be sent\n", ret);
}
else {
System_printf("Data sent successfully\n");
}

ret = HTTPCli_getResponseStatus(&cli); // here I get an error with code 400

  • Hi,

    ret = HTTPCli_getResponseStatus(&cli); // here I get an error with code 400

      See this link about error 400 - response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error

    https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400

      Also look at the below link for other codes that HTTPCli_getResponseStatus may return. 

    https://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/tirtos/2_14_04_31/exports/tirtos_full_2_14_04_31/docs/networkservices/doxygen/html/group__ti__net__http___h_t_t_p_std.html#gaee996bdb2c7693874706d971892e3285

      Your colleague already has the same post opened at https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1236170/tm4c129encpdt-https-communication-using-wolfssl---https-post. I will suggest you collaborate with him and combine your questions into the same post. I have asked him the below questions. Perhaps you can answer it here.

     Can you get it to work with a GET request? I'm not an expert in TLS. I guess the first thing is to know if this it is a client issue or server issue or certs issue. If you can get GET to work then it eliminates the server issue and the certs. But if the GET does not work then there are more variables to investigate what went wrong. 

  • Hello Charles,

    Thanks for the reply. I tried the https-get too. It is giving the same error 400. I doubt if my http configuration is not compatible somewhere with postman server.  Below is the HTTPGet I tried.

    Yes, my colleague was communicating earlier on this and she is out of office for few days. So I prefer to communicate in this thread, you may close the other one.

    Thanks.

    /*********** HTTPS Get Code *************/

    #define HOSTNAME "">https://postman-echo.com"
    #define REQUEST_URI "/get?foo1=bar1&foo2=bar2" //"/post"
    #define CONTENT_TYPE "application/json" //"text/plain"
    #define Authorization "Basic"
    #define USER_AGENT "HTTPCli (ARM; TI-RTOS)"
    #define NTP_HOSTNAME "pool.ntp.org"
    #define NTP_PORT "123"
    #define NTP_SERVERS 3
    #define NTP_SERVERS_SIZE (NTP_SERVERS * sizeof(struct sockaddr_in))
    #define HTTPTASKSTACKSIZE 32768

    HTTPCli_Params params;
    HTTPCli_Struct cli;
    HTTPCli_Field fields[3] = {
    { HTTPStd_FIELD_NAME_HOST, HOSTNAME },
    { HTTPStd_FIELD_NAME_CONTENT_TYPE, CONTENT_TYPE },
    { NULL, NULL }
    };

    // Response field filters
    char respFields[2] = {
    HTTPStd_FIELD_NAME_CONTENT_LENGTH,
    CONTENT_LENGTH};

    startNTP();

    System_printf("Sending a HTTPS POST request to '%s'\n", HOSTNAME);
    System_flush();

    TLS_Params_init(&tlsParams);
    tlsParams.ca = ca;
    tlsParams.calen = calen;

    tls = TLS_create(TLS_METHOD_CLIENT_TLSV1_2, &tlsParams, NULL);
    if (!tls) {
    printError("httpsTask: TLS create failed", -1);
    }

    //cli = HTTPCli_create();

    HTTPCli_construct(&cli);

    HTTPCli_setRequestFields(&cli, fields);

    HTTPCli_setResponseFields(&cli, respFields);

    ret = HTTPCli_initSockAddr((struct sockaddr *)&addr, "">postman-echo.com/.../get, 0);
    if (ret < 0) {
    printError("httpsTask: address resolution failed\n", ret);
    }

    params.tls = tls;
    HTTPCli_Params_init(&params);


    ret = HTTPCli_connect(&cli, (struct sockaddr *)&addr, HTTPCli_TYPE_TLS, &params);
    if (ret < 0) {
    printError("httpsTask: connect failed\n", ret);
    }


    ret = HTTPCli_sendRequest(&cli, HTTPStd_GET, REQUEST_URI, true);
    if (ret < 0) {
    printError("httpsTask: send failed\n", ret);
    }
    else
    {
    System_printf("sendRequest successful\n");
    }

    // ret = HTTPCli_getResponseField(&cli, data, 16, false);
    // if (ret < 0) {
    // printError("https-get failed", ret);
    // }
    // else
    // {
    // System_printf("HTTPS-GET successful\n");
    // }

    ret = HTTPCli_getResponseStatus(&cli); // Error 400 after calling HTTPCli_getResponseField

  • I am now getting a 200 OK response on posting.

    ret = HTTPCli_sendRequestBody(&cli, data, strlen(data));

    ret = HTTPCli_getResponseStatus(&cli); //Gives 200 Ok response


    ret = HTTPCli_getResponseField(&cli, RCVData, sizeof(RCVData), &moreFlag); // On executing this, the error handler is called. 

    I am not sure if I have set the response filter correctly. Below is my filter. 

    // Response field filters
    char respFields[2] = {
    NULL
    };

    And when I read the incoming data, I can see the echoed data in the receive buffer with a tag "Data". The received data is around 384 bytes. How can I edit the filter just to get the data from the response?

    ret = HTTPCli_readRawResponseBody(&cli, RCVData, sizeof(RCVData));

  • Hi Senannas,

    I am now getting a 200 OK response on posting.

    ret = HTTPCli_sendRequestBody(&cli, data, strlen(data));

    ret = HTTPCli_getResponseStatus(&cli); //Gives 200 Ok response

      Glad that you made good progress here. Can you please post your full code for POST so I can try it out too? I'd like know the exact difference between your current one that at least gets the OK response from the server vs the one you had yesterday. 

    I am not sure if I have set the response filter correctly. Below is my filter. 

    // Response field filters
    char respFields[2] = {
    NULL

    It seems to be correct. What you have is the same as what is shown in the POST example in the TI_RTOS Network Service user's guide. See this link and look for the POST example. https://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/tirtos/2_14_04_31/exports/tirtos_full_2_14_04_31/docs/networkservices/doxygen/html/group__ti__net__http___h_t_t_p_cli.html

    And when I read the incoming data, I can see the echoed data in the receive buffer with a tag "Data". The received data is around 384 bytes. How can I edit the filter just to get the data from the response?

    On the same user's guide, look for the section 'HTTP Header Fields'. However, I don't really see 'Body' as a filter . Not that I'm an expert in this, I think you will need to process/extract the body in your application. 

  • Hi Charles,

    Below is my code.

    Can I use either HTTPCli_readRawResponseBody or HTTPCli_getResponseField to read the data? In my case only HTTPCli_readRawResponseBody works.

    /*************** HTTPS Post **************/

    bool moreFlag = false;
    char data[64],RCVData[400];
    int ret;
    int len;
    char CONTENT_LENGTH[3];
    struct sockaddr_in addr;

    TLS_Params tlsParams;
    TLS_Handle tls;


    //Data to be sent
    //strcpy(data, "{\"val\": 10}");
    strcpy(data, "testdata");
    len = strlen(data);
    sprintf(CONTENT_LENGTH, "%d", len);

    System_printf("\nData: %s\n", data);
    System_printf("len(int): %d\n", len);
    System_printf("CONTENT_LENGTH: %s\n", CONTENT_LENGTH);

    HTTPCli_Params params;
    HTTPCli_Struct cli;
    HTTPCli_Field fields[3] = {
    { HTTPStd_FIELD_NAME_HOST, HOSTNAME },
    { HTTPStd_FIELD_NAME_CONTENT_TYPE, CONTENT_TYPE },
    { NULL, NULL }
    };

    // Response field filters
    char respFields[2] = {
    HTTPStd_FIELD_NAME_CONTENT_LENGTH,
    NULL};

    startNTP();

    System_printf("Sending a HTTPS POST request to '%s'\n", HOSTNAME);
    System_flush();

    TLS_Params_init(&tlsParams);
    tlsParams.ca = ca;
    tlsParams.calen = calen;

    tls = TLS_create(TLS_METHOD_CLIENT_TLSV1_2, &tlsParams, NULL);
    if (!tls) {
    printError("httpsTask: TLS create failed", -1);
    }

    HTTPCli_construct(&cli);

    HTTPCli_setRequestFields(&cli, fields);

    HTTPCli_setResponseFields(&cli, respFields);


    ret = HTTPCli_initSockAddr((struct sockaddr *)&addr,HOSTNAME, 0);
    if (ret < 0) {
    printError("httpsTask: address resolution failed\n", ret);
    }

    params.tls = tls;
    HTTPCli_Params_init(&params);


    ret = HTTPCli_connect(&cli, (struct sockaddr *)&addr, 0, &params);
    if (ret < 0) {
    printError("httpsTask: connect failed\n", ret);
    }


    ret = HTTPCli_sendRequest(&cli, HTTPStd_POST, REQUEST_URI, true);
    if (ret < 0) {
    printError("httpsTask: send failed\n", ret);
    }
    else
    {
    System_printf("sendRequest successful\n");
    }

    ret = HTTPCli_sendField(&cli, HTTPStd_FIELD_NAME_CONTENT_LENGTH, CONTENT_LENGTH, false);
    ret = HTTPCli_sendField(&cli, HTTPStd_FIELD_NAME_CONTENT_TYPE, CONTENT_TYPE, true);

    if (ret < 0) {
    printError("httpTask: send failed\n", ret);
    }
    else {
    System_printf("sendField successful\n");
    }
    ret = HTTPCli_sendRequestBody(&cli, data, strlen(data));
    if (ret < 0) {
    printError("httpTask: Variable data couldn't be sent\n", ret);
    }
    else {
    System_printf("Data sent successfully\n");
    }

    ret = HTTPCli_getResponseStatus(&cli);
    //ret = HTTPCli_readRawResponseBody(&cli, RCVData, sizeof(RCVData));
    ret = HTTPCli_getResponseField(&cli, RCVData, sizeof(RCVData), &moreFlag);

  • Hi Charles,

    As mentioned above code we using  "https://postman-echo.com" as Hostname to post data to server, but I am getting an error 400 while calling this HTTPCli_getResponseStatus(&cli).

    By using the "www.postman-echo.com" as hostname  it works well. 

    We need to post data using "https://postman-echo.com" as Hostname, How to solve this issue?

    /*****************defines*******************************************/
    #define HOSTNAME "">postman-echo.com" 
    #define REQUEST_URI "/post" 
    #define CONTENT_TYPE "application/json" 
    #define Authorization "Basic"
    #define USER_AGENT "HTTPCli (ARM; TI-RTOS)"
    #define NTP_HOSTNAME "pool.ntp.org"
    #define NTP_PORT "123"
    #define NTP_SERVERS 3
    #define NTP_SERVERS_SIZE (NTP_SERVERS * sizeof(struct sockaddr_in))
    #define HTTPTASKSTACKSIZE 32768

  • Hi Senannas,

      Can you also show your #define for HOSTNAME, REQUEST_URI  and the rest of #define shown below? Please also provide your certificate that you insert for ca[]. 

    #define HOSTNAME 

    #define REQUEST_URI 
    #define USER_AGENT "HTTPCli (ARM; TI-RTOS)"
    #define NTP_HOSTNAME "pool.ntp.org"
    #define NTP_PORT "123"
    #define NTP_SERVERS 3
    #define NTP_SERVERS_SIZE (NTP_SERVERS * sizeof(struct sockaddr_in))
    #define HTTPTASKSTACKSIZE 

    You should be able to enable wolfssl debug by calling wolfSSL_Debugging_ON(). if you have enable debug during wolfssl library at build time. See this link for detail. https://www.wolfssl.com/doxygen/group__Debug.html

  • Hi Anusree,

      Looks like our messages crossed each other. Please provide the ca[] too. 

     

    By using the "www.postman-echo.com" as hostname  it works well.

    Can you confirm that you are able to get the 200 OK response from the server to the MCU client? Please elaborate what do you mean this hostname works well? 

    we using  "https://postman-echo.com" as Hostname to post data to server, but I am getting an error 400 while calling this HTTPCli_getResponseStatus(&cli).

    400 should means that the client is sending a bad request. Please see below link for explanation. 

    https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400

     

    Can I use either HTTPCli_readRawResponseBody or HTTPCli_getResponseField to read the data? In my case only HTTPCli_readRawResponseBody works.

    Sorry, I'm really not a wolfssl expert and neither http. I think these APIs should work but I don't have the insights to explain why it didn't work for you. This is what I will suggest. 

      1. Can you please try a HTTP POST example without TLS using the same APIs like HTTPCli_readRawResponseBody or HTTPCli_getResponseField to read the response? If they work on a non-TLS example then it proves that there is no issue with calling them. 

      2. Can you please try a HTTPS GET example with TLS? Can you get it to work? This will help to narrow the problem if the problem is due to the difference between GET and POST or due to the certificate or others?

      3. Will you be able to use Wireshark to troubleshoot the issue?

  • Hi charles

    Actually I am trying to use https to post data to server. But I am not getting proper response. But I try to post data to server using http and get 200 OK response from server.

    /*********************************certificate*****************************************/

     -----BEGIN CERTIFICATE-----
    MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzEl
    MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMp
    U3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQw
    NjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UE
    ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZp
    ZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqGSIb3
    DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf
    8MOh2tTYbitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN
    +lq2cwQlZut3f+dZxkqZJRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0
    X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVmepsZGD3/cVE8MC5fvj13c7JdBmzDI1aa
    K4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSNF4Azbl5KXZnJHoe0nRrA
    1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HFMIHCMB0G
    A1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fR
    zt0fhvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0
    YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBD
    bGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8w
    DQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGsafPzWdqbAYcaT1epoXkJKtv3
    L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLMPUxA2IGvd56D
    eruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl
    xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynp
    VSJYACPq4xJDKVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEY
    WQPJIrSPnNVeKtelttQKbfi3QBFGmh95DmK/D5fs4C8fF5Q=
    -----END CERTIFICATE-----

    This certificate got from this link  https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/812332/rtos-ek-tm4c129exl-ti-rtos-https-post-sample.

     I also try with this https://www.amazontrust.com/repository/AmazonRootCA1.pem  certificate  but also I got the same result.

  • Actually I am trying to use https to post data to server. But I am not getting proper response. But I try to post data to server using http and get 200 OK response from server.

    Hi,

      Thanks for the clarification. It is the HTTP that works for you but not HTTPS. Since you have run HTTP successfully, the problem should not be related to the usage of APIs like HTTPCli_getResponseStatus, HTTPCli_readRawResponseBody and HTTPCli_getResponseField. 

      Are you able to use these API to filter the body you want in your HTTP test? 

      Do you have the same problem for HTTPS GET? If you can get HTTPS GET to work then the problem is not related to certs. If HTTPS GET also fails for the same reason then it is most likely due to the certs. 

      Do you have a chance to turn on WolfSSL debug. See this link again. 

    You should be able to enable wolfssl debug by calling wolfSSL_Debugging_ON() if you have enabled debug during wolfssl library at build time. See this link for detail. https://www.wolfssl.com/doxygen/group__Debug.html

    Since I'm really not an expert in WolfSSL, I will suggest you reach out to WolfSSL forum for assistance. Show them the debug log you have and hopefully they can provide some guidance. https://www.wolfssl.com/forums/

  • Hi Charles,

    I was totally in a wrong direction. The WolfSSL library was added to my project but it was never used hoping it will be used internally by TIRTOS. 

    I have created a WolfSSL context using below function. And also I have successfully verified the ca certificate.

    ctx = wolfSSL_CTX_new(wolfTLSv1_2_client_method());
    ret = wolfSSL_CTX_load_verify_buffer(ctx,ca,strlen(ca), SSL_FILETYPE_PEM);

    How will I link this context ctx to my cli which was created using HTTPCli_construct(&cli)?

  • I was totally in a wrong direction. The WolfSSL library was added to my project but it was never used hoping it will be used internally by TIRTOS. 

    Hi, Senannas,

      Although I'm not an WolfSSL expert, I do think that the existing https GET example is using WolfSSL library. Why do you think WolfSSL is never used by TI-RTOS. When you call tls = TLS_create(TLS_METHOD_CLIENT_TLSV1_2, &tlsParams, NULL), this is supposed to use the underlying WolfSSL library. 

     If you look at the callstack, see below, you will see that TLS_create will take you wolfSSL_CTX_new_ex. Just single step TLS_create to trace the callstack. 

    Earlier, I asked you to turn on WolfSSL debug feature. Did you have a chance to do that? Let me repeat again below. 

    You should be able to enable wolfssl debug by calling wolfSSL_Debugging_ON() if you have enabled debug during wolfssl library at build time. See this link for detail. https://www.wolfssl.com/doxygen/group__Debug.html

    Since I'm really not an expert in WolfSSL, I will suggest you reach out to WolfSSL forum for assistance. Show them the debug log you have and hopefully they can provide some guidance. https://www.wolfssl.com/forums/

  • Hi Charles,

    Thanks for the clarification on underlying wolfssl calls. I did find it too yesterday.

    I did enable the wolfssl debug, but it is returning a failure error. 

    #ifdef DEBUG_WOLFSSL_ON
    ret= wolfSSL_Debugging_ON();
    #endif /* DEBUG_WOLFSSL_ON */

    For the HTTPCli_initSockAddr function below is the URI format supported.

    The supported URI format is:
    * - [http[s]://]host_name[:port_number][/request_uri]
    *

    Which of my below usage is correct?

    ret = HTTPCli_initSockAddr((struct sockaddr *)&addr, "">https://postman-echo.com/post", 0);

    or

    ret = HTTPCli_initSockAddr((struct sockaddr *)&addr, "">https://postman-echo.com", 0);

  • I did enable the wolfssl debug, but it is returning a failure error. 

    #ifdef DEBUG_WOLFSSL_ON
    ret= wolfSSL_Debugging_ON();
    #endif /* DEBUG_WOLFSSL_ON */

    Did you rebuild your wolfssl library with for debug support?

    For the HTTPCli_initSockAddr function below is the URI format supported.

    The supported URI format is:
    * - [http[s]://]host_name[:port_number][/request_uri]
    *

    Which of my below usage is correct?

    ret = HTTPCli_initSockAddr((struct sockaddr *)&addr, "">https://postman-echo.com/post", 0);

    or

    ret = HTTPCli_initSockAddr((struct sockaddr *)&addr, "">https://postman-echo.com", 0);

    I don't really know. I have seen something like below with the 443 port number specified for the HOSTNAME. Of course this is for the host ev-root.chain-demos.digicert.com while you are using postman-echo.com. 

    #define HOSTNAME "ev-root.chain-demos.digicert.com:443"

    #define REQUEST_URI "/"
    #define USER_AGENT "HTTPCli (ARM; TI-RTOS)"
    #define NTP_HOSTNAME "pool.ntp.org"
    #define NTP_PORT "123"
    #define NTP_SERVERS 3
    #define NTP_SERVERS_SIZE (NTP_SERVERS * sizeof(struct sockaddr_in))
    #define HTTPTASKSTACKSIZE 32768*2

    In case you want to try out ev-root.chain-demos.digicert.com, here is the cert. However, I'm not able to get it to work for myself. Sorry for my lack of knowledge on tls. If you want to try ev-root.chain-demos.digicert.com:443, start with HTTPS GET first. 

    uint8_t ca[] =
    "MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs"
    "MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3"
    "d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j"
    "ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL"
    "MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3"
    "LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug"
    "RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm"
    "+9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW"
    "PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM"
    "xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB"
    "Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3"
    "hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg"
    "EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF"
    "MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA"
    "FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec"
    "nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z"
    "eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF"
    "hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2"
    "Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe"
    "vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep"
    "+OkuE6N36B9K";

  • Hi Charles,

    After rebuilding the wolfssl, the debug logs are received. Its stuck somewhere, repeating the same log. I have shared logs to Wolfssl team. 

    I will try the "ev-root.chain-demos.digicert.com:443" server and let you know. Thanks.

    /*************Debug log**************/

    Starting the HTTPS GET example
    System provider is set to SysMin. Halt the target to view any SysMin contents in ROV.
    Service Status: DHCPC : Enabled : : 000
    Service Status: DHCPC : Enabled : Running : 000
    Network Added: If-1:192.168.2.31
    Service Status: DHCPC : Enabled : Running : 017
    (int): 13
    CONTENT_LENGTH: 13
    Current time: Tue Jun 20 05:00:51 2023

    Sending a HTTPS POST request to 'https://postman-echo.com'
    wolfSSL Entering WOLFSSL_CTX_new_ex
    wolfSSL Entering wolfSSL_Init
    wolfSSL Entering wolfSSL_CertManagerNew
    wolfSSL Leaving WOLFSSL_CTX_new, return 0
    wolfSSL Entering wolfSSL_CTX_load_verify_buffer
    Adding a CA
    wolfSSL Entering GetExplicitVersion
    wolfSSL Entering GetMyVersion
    wolfSSL Entering GetSerialNumber
    Got Cert Header
    wolfSSL Entering GetAlgoId
    wolfSSL Entering GetObjectId()
    Got Algo ID
    Getting Cert Name
    Getting Cert Name
    Got Subject Name
    wolfSSL Entering GetAlgoId
    wolfSSL Entering GetObjectId()
    Got Key
    Parsed Past Key
    wolfSSL Entering DecodeCertExtensions
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeSubjKeyId
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeAuthKeyId
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeBasicCaConstraint
    wolfSSL Entering GetAlgoId
    wolfSSL Entering GetObjectId()
    Parsed new CA
    Freeing Parsed CA
    Freeing der CA
    OK Freeing der CA
    wolfSSL Leaving AddCA, return 0
    wolfSSL Entering SSL_new
    wolfSSL Leaving SSL_new, return 0
    wolfSSL Entering SSL_set_fd
    wolfSSL Leaving SSL_set_fd, return 1
    wolfSSL Entering wolfSSL_send()
    wolfSSL Entering SSL_write()
    handshake not complete, trying to finish
    wolfSSL Entering wolfSSL_negotiate
    wolfSSL Entering SSL_connect()
    growing output buffer

    Shrinking output buffer

    connect state: CLIENT_HELLO_SENT
    growing input buffer

    received record layer msg
    wolfSSL Entering DoHandShakeMsg()
    wolfSSL Entering DoHandShakeMsgType
    processing server hello
    wolfSSL Entering VerifyClientSuite
    wolfSSL Leaving DoHandShakeMsgType(), return 0
    wolfSSL Leaving DoHandShakeMsg(), return 0
    growing input buffer

    received record layer msg
    wolfSSL Entering DoHandShakeMsg()
    wolfSSL Entering DoHandShakeMsgType
    processing certificate
    Loading peer's cert chain
    Put another cert into chain
    Put another cert into chain
    Put another cert into chain
    Put another cert into chain
    wolfSSL Entering GetExplicitVersion
    wolfSSL Entering GetMyVersion
    wolfSSL Entering GetSerialNumber
    Got Cert Header
    wolfSSL Entering GetAlgoId
    wolfSSL Entering GetObjectId()
    Got Algo ID
    Getting Cert Name
    Getting Cert Name
    Got Subject Name
    wolfSSL Entering GetAlgoId
    wolfSSL Entering GetObjectId()
    Got Key
    Parsed Past Key
    wolfSSL Entering DecodeCertExtensions
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeBasicCaConstraint
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeKeyUsage
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeSubjKeyId
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeAuthKeyId
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeAuthInfo
    wolfSSL Entering GetObjectId()
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeCrlDist
    wolfSSL Entering GetObjectId()
    Certificate Policy extension not supported yet.
    wolfSSL Entering GetAlgoId
    wolfSSL Entering GetObjectId()
    About to verify certificate signature
    wolfSSL Using RSA PKCSV15 padding
    Adding CA from chain
    Adding a CA
    wolfSSL Entering GetExplicitVersion
    wolfSSL Entering GetMyVersion
    wolfSSL Entering GetSerialNumber
    Got Cert Header
    wolfSSL Entering GetAlgoId
    wolfSSL Entering GetObjectId()
    Got Algo ID
    Getting Cert Name
    Getting Cert Name
    Got Subject Name
    wolfSSL Entering GetAlgoId
    wolfSSL Entering GetObjectId()
    Got Key
    Parsed Past Key
    wolfSSL Entering DecodeCertExtensions
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeBasicCaConstraint
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeKeyUsage
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeSubjKeyId
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeAuthKeyId
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeAuthInfo
    wolfSSL Entering GetObjectId()
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeCrlDist
    wolfSSL Entering GetObjectId()
    Certificate Policy extension not supported yet.
    wolfSSL Entering GetAlgoId
    wolfSSL Entering GetObjectId()
    Parsed new CA
    Freeing Parsed CA
    Freeing der CA
    OK Freeing der CA
    wolfSSL Leaving AddCA, return 0
    wolfSSL Entering GetExplicitVer

  • Hi Charles

    After enabling wolfssl log, we got debug logs. wolfssl returns -308 is a socket error.

    wolfssl debug log:

    Sending a HTTPS POST request to 'https://postman-echo.com'
    wolfSSL Entering wolfSSL_Init
    wolfSSL Entering WOLFSSL_CTX_new_ex
    wolfSSL Entering wolfSSL_CertManagerNew
    wolfSSL Leaving WOLFSSL_CTX_new, return 0
    wolfSSL Entering WOLFSSL_CTX_new_ex
    wolfSSL Entering wolfSSL_CertManagerNew
    wolfSSL Leaving WOLFSSL_CTX_new, return 0
    wolfSSL Entering wolfSSL_CTX_load_verify_buffer
    Adding a CA
    wolfSSL Entering GetExplicitVersion
    wolfSSL Entering GetMyVersion
    wolfSSL Entering GetSerialNumber
    Got Cert Header
    wolfSSL Entering GetAlgoId
    wolfSSL Entering GetObjectId()
    Got Algo ID
    Getting Cert Name
    Getting Cert Name
    Got Subject Name
    wolfSSL Entering GetAlgoId
    wolfSSL Entering GetObjectId()
    Got Key
    Parsed Past Key
    wolfSSL Entering DecodeCertExtensions
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeSubjKeyId
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeAuthKeyId
    wolfSSL Entering GetObjectId()
    wolfSSL Entering DecodeBasicCaConstraint
    wolfSSL Entering GetAlgoId
    wolfSSL Entering GetObjectId()
    Parsed new CA
    Freeing Parsed CA
    Freeing der CA
    OK Freeing der CA
    wolfSSL Leaving AddCA, return 0
    wolfSSL Entering SSL_new
    wolfSSL Leaving SSL_new, return 0
    wolfSSL Entering SSL_set_fd
    wolfSSL Leaving SSL_set_fd, return 1
    wolfSSL Entering wolfSSL_send()
    wolfSSL Entering SSL_write()
    handshake not complete, trying to finish
    wolfSSL Entering wolfSSL_negotiate
    wolfSSL Entering SSL_connect()
    growing output buffer

    Shrinking output buffer

    connect state: CLIENT_HELLO_SENT
    growing input buffer

    received record layer msg
    wolfSSL Entering DoHandShakeMsg()
    wolfSSL Entering DoHandShakeMsgType
    processing server hello
    wolfSSL Entering VerifyClientSuite
    wolfSSL Leaving DoHandShakeMsgType(), return 0
    wolfSSL Leaving DoHandShakeMsg(), return 0
    growing input buffer

    Embed Receive error
    Connection reset
    wolfSSL error occurred, error = -308
    wolfSSL Leaving wolfSSL_negotiate, return -1
    wolfSSL Leaving SSL_write(), return -1
    wolfSSL Leaving wolfSSL_send(), return -1
    wolfSSL Entering SSL_get_error
    wolfSSL Leaving SSL_get_error, return -308

  • Hi,

      I'm not sure why a -308 error code for socket error. I still think it has something to do with the certs which I don't have much experience with. Sorry to leave you in a state of no guidance. Have you had a chance to ask WolfSSL for some guidance on what could cause -308? We know that in non SSL, both GET/POST will work. Have you passed the line HTTPCli_connect?

     Have you tried other servers other than postman?

  • Hi,

    We  have also  tried with ev-root.chain-demos.digicert.com:443.As per wolfssl -308 is due to some socket related issues.so i am doubtful about the socket creation API used. I tried below  methods, but no luck. Could you please check with your experts on how to use the  HTTPCli_initSockAddr  API to create a secure socket.

    For the HTTPCli_initSockAddr function below is the URI format supported.

    The supported URI format is:
    * - [http[s]://]host_name[:port_number][/request_uri]
    *

    Which of my below usage is correct?

    ret = HTTPCli_initSockAddr((struct sockaddr *)&addr, "https://postman-echo.com/post", 0);

    or

    ret = HTTPCli_initSockAddr((struct sockaddr *)&addr, "https://postman-echo.com", 0);

    or

      ret = HTTPCli_initSockAddr((struct sockaddr *)&addr, "https://postman-echo.com",HTTPCli_TYPE_TLS);

  • Are you failing HTTPCli_initSockAddr with the print error for address resolution failed? Are you running this in your company network? You might want to check with your IT department if there is any firewall blocking from accessing internet. Can you try on a different network like your home network. This will at least prove if you are getting different type of errors due to the network. It is still possible that the code may fail but it may run a few more lines due to a different errors. 

    ret = HTTPCli_initSockAddr((struct sockaddr *)&addr, HOSTNAME, 0);
    if (ret < 0) {
    printError("httpsTask: address resolution failed", ret);
    }

    Can you try ret = HTTPCli_initSockAddr((struct sockaddr *)&addr, "https://postman-echo.com:443", 0);

  • HTTPCli_initSockAddr return  success , but HTTPCli_sendRequest() always returns error -103, which causes socket error -308 (error condition on socket) to run the WOLFSSL debug log, HTTPCli_connect() always succeeds. Is this issue related to Cipher Suite?

     

    ret = HTTPCli_initSockAddr((struct sockaddr *)&addr, HOSTNAME, 0);
    if (ret < 0) {
    printError("httpsTask: address resolution failed", ret);
    }

    HTTPCli_Params_init(&params);
    params.tls = tls;

    ret = HTTPCli_connect(&cli, (struct sockaddr *)&addr, 0, &params);
    if (ret < 0) {
    printError("httpsTask: connect failed", ret);
    }


    ret = HTTPCli_sendRequest(&cli, HTTPStd_POST, REQUEST_URI, false);  //return -103
    if (ret < 0) {
    printError("httpsTask: send failed", ret);
    }

  • HTTPCli_sendRequest() always returns error -103, which causes socket error -308 (error condition on socket) to run the WOLFSSL debug log, HTTPCli_connect() always succeeds. Is this issue related to Cipher Suite?

    I think it has something to do with cipher suite but sorry, I'm unable to provide guidance here as I'm not an expert for WolfSSL stacks. Have you had a chance to contact WolfSSL and do they have any recommendation?

  • Hi charles,

    what does the error info below mean?

    ti.sysbios.heaps.HeapMem: line 361: out of memory: handle=0x2001cba4, size=8324

    What does handle =0x2001cba4 mean? What does size = 8324 mean?

    How to resolve the issue?

    I have another query related the program execution

    1)How to retrieve the program from abnormal termination(abort)


    /****************************************************************************/
    /* ABORT - ABNORMAL PROGRAM TERMINATION. CURRENTLY JUST HALTS EXECUTION. */
    /****************************************************************************/
    __attribute__((section(".text:abort")))
    void abort(void{
    #if defined(EMBED_CIO_BP)
    __asm(" .global C$$EXITE");
    #if defined(__32bis__)
    __asm("C$$EXITE:.word 0xDEFED0FE");
    #else
    __asm(" .align 4");
    #if defined(__big_endian__)
    __asm("C$$EXITE:.half 0xDEFE");
    #else
    __asm("C$$EXITE:.half 0xD0FE");
    #endif /* __big_endian__ */
    #endif /* __32bis__ */

    #else /* !EMBED_CIO_BP */
    __asm(" .global C$$EXIT");
    __asm("C$$EXIT: nop");
    #endif

    for (;;); /* SPINS FOREVER */
    }

  • Hi charles

    The heap issue is resolved. But some time While  post data to server using https I got an error like "00039.200 TcpTimeoutRexmt  Retransmit Timeout" and Why get this error? 

  • Hi Anusree,

    The heap issue is resolved.

    Can you first clarify what did you change to resolve the heap issue? Was the suggestions I provided in the last reply help you resolve the issue?

    But some time While  post data to server using https I got an error like "00039.200 TcpTimeoutRexmt  Retransmit Timeout" and Why get this error?

    Here you said 'some time'. Does that mean that there are times where it is working? In another word, when it is working, you are getting the HTTPS to work? Is that a correct understanding. 

    I find these posts that discussed about this error. Can you take a look and see if they applied to you?

    https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/675774/rtos-tm4c1292ncpdt-tcptimeoutrexmt-retransmit-timeout--error-while-communicating-to-external-system-in-100-mbps?ReplyFilter=Answers&ReplySortBy=Answers&ReplySortOrder=Descending

    https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/627766/rtos-tm4c1294ncpdt-tcptimeoutrexmt-retransmit-timeout

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/574463/rtos-tcp-packet-loss-in-ti-rtos-ndk

    https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/674812/rtos-ek-tm4c1294xl-ndk-in-ti-rtos-for-tivac-2-16-1-14-can-get-into-a-state-where-unable-to-transmit-packets

  • Can you first clarify what did you change to resolve the heap issue? Was the suggestions I provided in the last reply help you resolve the issue?

    Yours last reply help me to resolve the heap issue.

    Here you said 'some time'. Does that mean that there are times where it is working? In another word, when it is working, you are getting the HTTPS to work? Is that a correct understanding. 

    Fixed tcp timeout issue after reducing heap size from 90112 to 70926. But there was an issue in posting the data to server. At that time I used the hardware supported wolfssl library.

    Now My issues are resolved by using the software supported WolfSSL library to secure the device.

    But I really want to implement the hardware supported wolfssl library. Does it require additional configuration?

  • Hi Anusree,

    Yours last reply help me to resolve the heap issue.

    Glad your heap issue is resolved. 

    Now My issues are resolved by using the software supported WolfSSL library to secure the device.

    - Can you please elaborate how did you resolve with the software WolfSSL library? Can you post your updated code snippet like what you did before? Below was your last posted code. What did you modify to make it at least partially work this time using the software library?

    /*************** HTTPS Post **************/
    
    bool moreFlag = false;
    char data[64],RCVData[400];
    int ret;
    int len;
    char CONTENT_LENGTH[3];
    struct sockaddr_in addr;
    
    TLS_Params tlsParams;
    TLS_Handle tls;
    
    
    //Data to be sent
    //strcpy(data, "{\"val\": 10}");
    strcpy(data, "testdata");
    len = strlen(data);
    sprintf(CONTENT_LENGTH, "%d", len);
    
    System_printf("\nData: %s\n", data);
    System_printf("len(int): %d\n", len);
    System_printf("CONTENT_LENGTH: %s\n", CONTENT_LENGTH);
    
    HTTPCli_Params params;
    HTTPCli_Struct cli;
    HTTPCli_Field fields[3] = {
    { HTTPStd_FIELD_NAME_HOST, HOSTNAME },
    { HTTPStd_FIELD_NAME_CONTENT_TYPE, CONTENT_TYPE },
    { NULL, NULL }
    };
    
    // Response field filters
    char respFields[2] = {
    HTTPStd_FIELD_NAME_CONTENT_LENGTH,
    NULL};
    
    startNTP();
    
    System_printf("Sending a HTTPS POST request to '%s'\n", HOSTNAME);
    System_flush();
    
    TLS_Params_init(&tlsParams);
    tlsParams.ca = ca;
    tlsParams.calen = calen;
    
    tls = TLS_create(TLS_METHOD_CLIENT_TLSV1_2, &tlsParams, NULL);
    if (!tls) {
    printError("httpsTask: TLS create failed", -1);
    }
    
    HTTPCli_construct(&cli);
    
    HTTPCli_setRequestFields(&cli, fields);
    
    HTTPCli_setResponseFields(&cli, respFields);
    
    
    ret = HTTPCli_initSockAddr((struct sockaddr *)&addr,HOSTNAME, 0);
    if (ret < 0) {
    printError("httpsTask: address resolution failed\n", ret);
    }
    
    params.tls = tls;
    HTTPCli_Params_init(&params);
    
    
    ret = HTTPCli_connect(&cli, (struct sockaddr *)&addr, 0, &params);
    if (ret < 0) {
    printError("httpsTask: connect failed\n", ret);
    }
    
    
    ret = HTTPCli_sendRequest(&cli, HTTPStd_POST, REQUEST_URI, true);
    if (ret < 0) {
    printError("httpsTask: send failed\n", ret);
    }
    else
    {
    System_printf("sendRequest successful\n");
    }
    
    ret = HTTPCli_sendField(&cli, HTTPStd_FIELD_NAME_CONTENT_LENGTH, CONTENT_LENGTH, false);
    ret = HTTPCli_sendField(&cli, HTTPStd_FIELD_NAME_CONTENT_TYPE, CONTENT_TYPE, true);
    
    if (ret < 0) {
    printError("httpTask: send failed\n", ret);
    }
    else {
    System_printf("sendField successful\n");
    }
    ret = HTTPCli_sendRequestBody(&cli, data, strlen(data));
    if (ret < 0) {
    printError("httpTask: Variable data couldn't be sent\n", ret);
    }
    else {
    System_printf("Data sent successfully\n");
    }
    
    ret = HTTPCli_getResponseStatus(&cli);
    //ret = HTTPCli_readRawResponseBody(&cli, RCVData, sizeof(RCVData));
    ret = HTTPCli_getResponseField(&cli, RCVData, sizeof(RCVData), &moreFlag);

    - Which server did you connect to? Is it postman-echo.com or any server?

    - Earlier you were having issue connecting to post-echo.com and you were asking if the server time was correct or not. How did you resolve it? Was the problem purely related to heap allocation?

    - Which ca[] did you use? Can you show the certificate?

    But I really want to implement the hardware supported wolfssl library. Does it require additional configuration?

    Please see below. There are two wolfssl libraries to link with when building your project. You can link to wolfssl_tm4c_hw.aem4f library. This wolfssl library will utilize the TM4C129 hardware security engines like AES for data encryption and decryption. If you want to use the software library you would need to link to wolfssl.aem4f. If there are certain features that you want to be part either the wolfssl.aem4f or  wolfssl_tm4c_hw.aem4f then you would need to rebuild the wolfssl library. 

  • Hi charles 

    The code remains same, the only change in the Hostname declaration which is "www.postman-echo.com:443".

    the second issue was because  we were using wolfssl_tm4c_hw.aem4f library initially which didn't work. Later we changed to software library wolfssl.aem4f.Now I would like to use the AES Hardware Accelerator  wolfssl_tm4c_hw.aem4f .if there is any installation required to use  the hardware module ?

    Certificate used: 

    uint8_t ca[] ="MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzEl\
    MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMp\
    U3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQw\
    NjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UE\
    ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZp\
    ZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqGSIb3\
    DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf\
    8MOh2tTYbitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN\
    +lq2cwQlZut3f+dZxkqZJRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0\
    X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVmepsZGD3/cVE8MC5fvj13c7JdBmzDI1aa\
    K4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSNF4Azbl5KXZnJHoe0nRrA\
    1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HFMIHCMB0G\
    A1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fR\
    zt0fhvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0\
    YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBD\
    bGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8w\
    DQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGsafPzWdqbAYcaT1epoXkJKtv3\
    L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLMPUxA2IGvd56D\
    eruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl\
    xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynp\
    VSJYACPq4xJDKVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEY\
    WQPJIrSPnNVeKtelttQKbfi3QBFGmh95DmK/D5fs4C8fF5Q=";

  • The code remains same, the only change in the Hostname declaration which is "www.postman-echo.com:443".

    Thanks for the clarification. A while back I did suggest you try www.postman-echo.com:443. Below was my earlier reply. 

    Are you failing HTTPCli_initSockAddr with the print error for address resolution failed? Are you running this in your company network? You might want to check with your IT department if there is any firewall blocking from accessing internet. Can you try on a different network like your home network. This will at least prove if you are getting different type of errors due to the network. It is still possible that the code may fail but it may run a few more lines due to a different errors. 

    ret = HTTPCli_initSockAddr((struct sockaddr *)&addr, HOSTNAME, 0);
    if (ret < 0) {
    printError("httpsTask: address resolution failed", ret);
    }

    Can you try ret = HTTPCli_initSockAddr((struct sockaddr *)&addr, "https://postman-echo.com:443", 0);

    the second issue was because  we were using wolfssl_tm4c_hw.aem4f library initially which didn't work. Later we changed to software library wolfssl.aem4f.Now I would like to use the AES Hardware Accelerator  wolfssl_tm4c_hw.aem4f .if there is any installation required to use  the hardware module ?

    TM4C129EKCPDT does support AES. I suppose wolfssl_tm4c_hw.aem4f library would use the AES accelerator. Is your problem that wolfssl_tm4c_hw.aem4f library does not call the AES accelerator or it called AES accelerator but does not return the correct encrypted/decrypted data. If the former, I will suggest you contact WolfSSL. I don't know if there is any MACRO that needs to be enabled first so that you can rebuild wolfssl_tm4c_hw.aem4f library.