This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

secure http issue, works first time, data corruption after first time...

I"m using SLM from NCS 1.6.1.  

I'm testing HTTPCREQ with HTTPC port 443 and security tag = 1.   After I reset SLM, my send is successful and passes server validation checks.  If I repeat the procedure sending the exact same data, the server is detecting a validation failure indicating something in the data has changed.  The only way to get a successful server validation is by reseting SLM.  I suspect there is some state that is not complete reset by XHTTPCCON=0 in the TLS implementation.   When I test the same with non-secure HTTP (port 80) to postman-echo my payloads are identical.  

Is there any equivalent to postman-echo with an https variant? 

Any idea why it breaks after the first successful attempt?

Parents
  • Hi Anthony,

    I just get more feedback from our expert:

    I've created a tera term script to test the large HTTP POST over TLS. Customer can conduct the same test and verify any uart/http data loss.

    The test is based on AWS IoT, below link provide useful information to create a thing and update certificates:
    http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/aws_fota/README.html#creating-a-thing-in-aws-iot
    http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/aws_fota/README.html#updating-the-certificates

    The Teraterm script asks SLM to:
    1. Connect to NBIOT network
    2. Connect to AWS with security tag 10
    3. Send POST request with 1500 bytes payload
    4. Send POST request with 2000 bytes payload

    To verify the request, please use AWS MQTT test client of AWS IoT console to subscribe the 'topic' MQTT topic. Then it is easy to check the payload.

    sendln 'AT#XRESET'
    waitln 'OK'
    waitln 'Ready'
    sendln 'AT+CIND=1,1,1'
    waitln 'OK'
    sendln 'AT%XSYSTEMMODE=0,1,0,0'
    waitln 'OK'
    sendln 'AT+CFUN=1'
    waitln '+CIND: "service",1'
    sendln 'at#xhttpccon=1,"a3ddngyx8yczzz-ats.iot.us-west-2.amazonaws.com",8443,10'
    waitln 'OK'
    sendln 'AT#XHTTPCREQ="POST","/topics/topic?qos=1","User-Agent: curl/7.58.0'
    sendln 'accept: */*'
    sendln 'Content-Type: application/x-www-form-urlencoded'
    sendln 'Content-Length: 1500'
    sendln '",1500'
    waitln '#XHTTPCREQ: 1'
    send '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
    send '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
    send '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
    waitln '#XDATAMODE: 0'
    sendln 'AT#XHTTPCREQ="POST","/topics/topic?qos=1","User-Agent: curl/7.58.0'
    sendln 'accept: */*'
    sendln 'Content-Type: application/x-www-form-urlencoded'
    sendln 'Content-Length: 2000'
    sendln '",2000'
    waitln '#XHTTPCREQ: 1'
    send '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
    send '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
    send '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
    send '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
    waitln '#XDATAMODE: 0'
    sendln 'at#xhttpccon=0'
    waitln 'OK'

    Best regards,

    Charlie

Reply
  • Hi Anthony,

    I just get more feedback from our expert:

    I've created a tera term script to test the large HTTP POST over TLS. Customer can conduct the same test and verify any uart/http data loss.

    The test is based on AWS IoT, below link provide useful information to create a thing and update certificates:
    http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/aws_fota/README.html#creating-a-thing-in-aws-iot
    http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/aws_fota/README.html#updating-the-certificates

    The Teraterm script asks SLM to:
    1. Connect to NBIOT network
    2. Connect to AWS with security tag 10
    3. Send POST request with 1500 bytes payload
    4. Send POST request with 2000 bytes payload

    To verify the request, please use AWS MQTT test client of AWS IoT console to subscribe the 'topic' MQTT topic. Then it is easy to check the payload.

    sendln 'AT#XRESET'
    waitln 'OK'
    waitln 'Ready'
    sendln 'AT+CIND=1,1,1'
    waitln 'OK'
    sendln 'AT%XSYSTEMMODE=0,1,0,0'
    waitln 'OK'
    sendln 'AT+CFUN=1'
    waitln '+CIND: "service",1'
    sendln 'at#xhttpccon=1,"a3ddngyx8yczzz-ats.iot.us-west-2.amazonaws.com",8443,10'
    waitln 'OK'
    sendln 'AT#XHTTPCREQ="POST","/topics/topic?qos=1","User-Agent: curl/7.58.0'
    sendln 'accept: */*'
    sendln 'Content-Type: application/x-www-form-urlencoded'
    sendln 'Content-Length: 1500'
    sendln '",1500'
    waitln '#XHTTPCREQ: 1'
    send '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
    send '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
    send '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
    waitln '#XDATAMODE: 0'
    sendln 'AT#XHTTPCREQ="POST","/topics/topic?qos=1","User-Agent: curl/7.58.0'
    sendln 'accept: */*'
    sendln 'Content-Type: application/x-www-form-urlencoded'
    sendln 'Content-Length: 2000'
    sendln '",2000'
    waitln '#XHTTPCREQ: 1'
    send '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
    send '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
    send '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
    send '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
    waitln '#XDATAMODE: 0'
    sendln 'at#xhttpccon=0'
    waitln 'OK'

    Best regards,

    Charlie

Children
No Data
Related