Secure HTTP connection nRF9160

Hi.

We have a custom pcb board. The main chip is an ESP32, and we use an Actinius SOM, that's basically an nRF9160, to bring LTE connection. The ESP32 should read sensor data and send it to a server using the nRF9160 that runs the "AT Client" program. That works fine unless the server asks for a secure connection. 

Example of HTTP GET non-secure request:

10:49:52.706 -> AT
10:50:02.503 -> 
10:50:02.503 -> OK
10:50:02.503 -> 
10:50:02.503 -> AT+CFUN=1
10:50:12.311 -> 
10:50:12.311 -> OK
10:50:12.311 -> 
10:50:12.311 -> AT+CFUN?
10:50:22.059 -> 
10:50:22.059 -> +CFUN: 1
10:50:22.059 -> 
10:50:22.059 -> OK
10:50:22.059 -> 
10:50:22.059 -> AT#XHTTPCCON=1,"postman-echo.com",80
10:50:32.834 -> 
10:50:32.834 -> #XHTTPCCON: 1
10:50:32.834 -> 
10:50:32.834 -> OK
10:50:32.834 -> 
10:50:32.834 -> AT#XHTTPCREQ="GET","/get?foo1=bar1&foo2=bar2",""
10:50:43.485 -> 
10:50:43.485 -> OK
10:50:43.485 -> 
10:50:43.485 -> #XHTTPCREQ: 0
10:50:43.485 -> HTTP/1.1 200 OK
10:50:43.485 -> Date: Mon, 26 Jun 2023 08:50:33 GMT
10:50:43.485 -> Content-Type: application/json; charset=utf-8
10:50:43.485 -> Content-Length: 299
10:50:43.485 -> Connect
10:50:43.485 -> AT+CFUN=0
An example of a secure HTTP GET request, it doesn't give any errors, but the request isn't even triggered on the server side, and there is no response from the server (Should answer "Data received" as shown in the next Python example) and #XHTTPCRSP:0,1 should not be 0.


10:43:02.320 -> AT
10:43:12.079 -> 
10:43:12.079 -> OK
10:43:12.079 -> 
10:43:12.079 -> AT+CFUN=1
10:43:21.892 -> 
10:43:21.892 -> OK
10:43:21.892 -> 
10:43:21.892 -> AT+CFUN?
10:43:31.682 -> 
10:43:31.682 -> +CFUN: 1
10:43:31.682 -> 
10:43:31.682 -> OK
10:43:31.682 -> 
10:43:31.682 -> AT#XHTTPCCON=1,"script.google.com",443
10:43:42.304 -> 
10:43:42.304 -> #XHTTPCCON: 1
10:43:42.304 -> 
10:43:42.304 -> OK
10:43:42.304 -> 
10:43:42.304 -> AT#XHTTPCREQ="GET","/macros/s/AKfycbzc5ghe0cgpHwTN-vbEpeQm9zSQxc6zLYxP9qKinF03yGKAsJtkJHgdsmilMXwjWpui/exec?id=llsja02&data=011-000---085"
10:43:52.278 -> 
10:43:52.278 -> OK
10:43:52.278 -> 
10:43:52.278 -> #XHTTPCREQ: 0
10:43:52.278 -> 
10:43:52.278 -> #XHTTPCRSP:0,1
10:43:52.278 -> 
10:43:52.278 -> AT+CFUN=0
10:44:03.678 -> 
10:44:03.678 -> OK
An example of the same HTTP GET request made from Python to check that it works:
import requests

url = 'http://script.google.com:/macros/s/AKfycbzc5ghe0cgpHwTN-vbEpeQm9zSQxc6zLYxP9qKinF03yGKAsJtkJHgdsmilMXwjWpui/exec?' +"id=" + "llsja02" + "&data=" + "011-000---085"
print (url)
r = requests.get(url, verify=True)
print("Response from server: " + r.text)
The response:
http://script.google.com:/macros/s/AKfycbzc5ghe0cgpHwTN-vbEpeQm9zSQxc6zLYxP9qKinF03yGKAsJtkJHgdsmilMXwjWpui/exec?id=llsja02&data=011-000---085
Response from server: Data received!
How should I proceed to get this work?
Best regards, Ander.

Parents Reply Children
No Data
Related