Hi,
I am using a UC200T-GL to communicate with the Google Cloud Platform using HTTPS, and met with some problems.
The aim is to use a Google service account, to interact with Google Cloud Platform. For this to happen, we will first authenticate with the Google server by sending a JSON Web Token (JWT). The Google server will then provide us with an access token for further interaction (such as uploading files). This process is via HTTPS POST request. I have provided a link below that contains the details:
Using OAuth 2.0 for Server to Server Applications
In this aspect, I have tried two examples in the UC20 HTTP AT Commands manual to get a feel of how it works. Example 3.2.1 works (HTTPS with GET request), example 3.1.2.1 does not work (HTTP with POST request, I think it might be a permission issue). Then I went ahead to use QNavigator to test this out. The commands log is as follow, to setup the HTTP config and SSL, all executed without issue.
AT+QHTTPCFG=“contextid”,1
AT+QHTTPCFG=“sslctxid”,1
AT+QSSLCFG=“sslversion”,1,1
AT+QSSLCFG=“ciphersuite”,0xFFFF
AT+QSSLCFG=“seclevel”,1,0
AT+QHTTPCFG=“requestheader”,1
This was then followed by entering the authentication URL and the POST request to supply the JWT (JWT is the parameter in the body. The headers are also customized). As per the manual, each line of the customized header is appended with a character (not shown here).
AT+QHTTPURL=35,60
CONNECT
HTTPs://oauth2.googleapis.com/token
OK
AT+QHTTPPOST=847,80,80
CONNECT
POST /token HTTP/1.1
Host: oauth2.googleapis.com
Content-Type: application/x-www-form-urlencoded
grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=
OK
Then, I attempted to read the response from the Google server, and this is where there was an issue:
AT+QHTTPREAD=80
+CME ERROR: HTTP(S) no GET/POST requests
I checked the UC20 HTTP AT Commands manual, and this error has a number 705. What does this mean? Is it that the Google Server did not respond to the POST request?
Previously we have created a prototype program that performed the same task with the Google Cloud platform on Windows, and the communication worked without needing to configure SSL. Thus, we repeated this on the UC200T but it had the same “HTTP(S) no GET/POST” error, so we then configured SSL for the UC200T as shown above, using the broad SSL settings given in the example. Unfortunately the error still persisted.
May I know what could be a possible reason for this error? Or if anyone has any pointers I will be grateful. Thanks!
Best regards,
Victor