SLL+HTTPS example

BG96 example of getting a binary file from remote server:
If you are connecting to a HTTPS server with no authentication, you can set AT+QSSLCFG=”seclevel”,0

For security level 1 or 2, then you need to load the certificate in RAM or file system using the file commands.  You may need to contact a certificate authority to get this, and setup the certificate also on the server.

AT+QICSGP=1,1,”<company.apn>”,””,””,1
OK
AT+QIACT=1,1
OK
AT+QIACT?
+QIACT: 1,1,1,”120.157.4.111″
OK
AT+QFLST=”*” //check the certificate is loaded in memory, use file commands
+QFLST: “TP20_RootCA.crt”,4306
+QFLST: “cacert.pem”,1212
+QFLST: “mcfg_sw.mbn”,26812
+QFLST: “security/”,2
OK
AT+QSSLCFG=”ciphersuite”,1,0XFFFF;+QSSLCFG=”sslversion”,1,3;+QSSLCFG=”seclevel”,1,1;+QSSLCFG=”checkhost”,1,0;+QSSLCFG=”ignorecertchain”,1,1;+QSSLCFG=”ignorelocaltime”,1,1;+QSSLCFG=”negotiatetime”,1,20;+QSSLCFG=”cacert”,1,”cacert.pem”
OK
AT+QHTTPCFG=”contextid”,1;+QHTTPCFG=”sslctxid”,1;+QHTTPCFG=”requestheader”,1;+QHTTPCFG=”responseheader”,0;+QHTTPCFG=”contenttype”,2
OK
AT+QHTTPURL=67,120                                                             
CONNECT                                                                        
Send https://www.xxxxxxxxxxx.com/data/upgrade/package_xxxxxxxxxxxxxx.bin
OK                                                                             
AT+QHTTPGET=60,261,120                                                         
CONNECT 
Send  
HEAD /data/upgrade/package_xxxxxxxxxxxxxx.bin HTTP/1.1
Host: www.xxxxxxxxxxx.com
Accept: text/html, */*
Authorization: Basic YWRtaW46YWRtaW4=
User-Agent: IOE Client
Content-Type: application/octet-stream
Connection: keep-alive
Cache-control: no-cache

OK                                                                             

+QHTTPGET: 0,200,112527