SIM7020 Series - TLS - Application Note - V1.03
SIM7020 Series - TLS - Application Note - V1.03
SIM7020 Series - TLS - Application Note - V1.03
SIM7020 Series_TLS
_Application Note
LPWA Module
GENERAL NOTES
COPYRIGHT
www.simcom.com 2 / 10
SIM7020 Series_TLS_Application Note_V1.03
About Document
Version History
Scope
www.simcom.com 3 / 10
SIM7020 Series_TLS_Application Note_V1.03
Contents
About Document .................................................................................................................... 3
Version History ...................................................................................................................................... 3
Scope .................................................................................................................................................... 3
Contents ................................................................................................................................. 4
1 Introduction ...................................................................................................................... 5
1.1 Purpose of the document ............................................................................................................ 5
1.2 Related documents ..................................................................................................................... 5
1.3 Conventions and abbreviations ................................................................................................... 5
www.simcom.com 4 / 10
SIM7020 Series_TLS_Application Note_V1.03
1 Introduction
Based on module AT command manual, this document will introduce TLS application process.
Developers could understand and develop application quickly and efficiently based on this document.
In application, controlling device controls the GSM engine by sending AT Command via its serial interface.
The controlling device at the other end of the serial line is referred to as following term:
TE (Terminal Equipment);
DTE (Data Terminal Equipment) or plainly "the application" which is running on an embedded system;
www.simcom.com 5 / 10
SIM7020 Series_TLS_Application Note_V1.03
2 TLS Introduction
SSL (Secure Sockets Layer), a security protocol. It was put forward by Netscape in the first version of Web
browser. The aim is to provide security and data integrity for network communications. SSL encrypts the
network connections at the transport layer.
SSL uses public key technology to ensure the confidentiality and reliability of communication between two
applications and to ensure that communication between client and server applications is not eaves dropped
by attackers. It can be supported at both ends of the server and client, and has become an industrial
standard for secure communication over the Internet. Current Web browsers generally combine HTTP and
SSL to achieve secure communication. This Agreement and its successor are TLS (Transport Layer
Security, TLS).
TLS uses key algorithm to provide endpoint authentication and communication security on the Internet, It is
based on the public key infrastructure. In typical implementations, however, only the network server is
authenticated reliably, while the client is not necessarily. This is because the public key infrastructure is
generally commercial, and electronic signature certificates usually need to be paid for. The protocol is
designed to enable master-slave architecture application communication itself to prevent tapping,
tampering, and message forgery.
www.simcom.com 6 / 10
SIM7020 Series_TLS_Application Note_V1.03
3 Bearer Configuration
Usually module will register PS service automatically.
OK
AT+CSQ // Check RF signal
+CSQ: 27,99
OK
AT+CGATT? // Check PS service. 1 indicates PS has attached.
+CGATT: 1
OK
AT+CGACT? // PDN active success
+CGACT:1,1
OK
AT+COPS? // Query Network information, operator and
+COPS:0,0,”CHN-UNICOM”,9 network mode 9, NB-IOT network
OK
AT+CGCONTRDP // Attached PS domain and got IP address
+CGCONTRDP: automatically
1,5,"shnbiot","10.250.0.213.255.255.255.0"
OK
www.simcom.com 7 / 10
SIM7020 Series_TLS_Application Note_V1.03
AT+CFUN=0 // Disable RF
+CPIN: NOT READY
OK
AT*MCGDEFCONT="IP","3GNET" // Set the APN manually
OK
AT+CFUN=1 // Enable RF
OK
+CPIN:READY
AT+CGATT? // Inquiry PS service
+CGATT: 1
OK
AT+CGCONTRDP // Attached PS domain and got IP address
+CGCONTRDP: automatically
1,5,"3GNET","10.250.0.253.255.255.255.0"
OK
www.simcom.com 8 / 10
SIM7020 Series_TLS_Application Note_V1.03
4 TLS Examples
OK
AT+CTLSCFG=1,6,1344,1,"HHxvYPZP9al4jwqj+
8n\r\nYMPGn8u67GB9t+aEMr5P+1gmIgNb1LTV
+/Xjli5wwOQuvfwu7uJBVcA0Ln0kcmnL\r\nR7E
UQIN9Z/SG9jGr8XmksrUuEvmEF/Bibyc+E1ixV
A0hmnM3oTDPb5Lc9un8rNsu\r\nKNF+AksjoB
XyOGVkCeoMbo4bF6BxyLObyavpw/LPh5aPg
//Configure TLS server instance, parameters
AIynplYb6LVAgMBAAGj\r\ngZUwgZIwDAYDVR
include, <tid>:1 ;<server name>: 1; server ip:
0TBAUwAwEB/zAdBgNVHQ4EFgQUtFrkpbPe0l
182.150.27.42; <prot>: 2; <port>: 50090; <socket
L2udWmlQ/rPrzH\r\n/f8wYwYDVR0jBFwwWoA
type>:3 for 0 –tcp; <Authentication mode>: 4,
UtFrkpbPe0lL2udWmlQ/rPrzH/f+hP6Q9MDsxCz
value is 0-none; <debug level> : 5, value is 2.
AJBgNV\r\nBAYTAk5MMREwDwYDVQQKEwh
Qb2xhclNTTDEZMBcGA1UEAxMQUG9sYXJTU
0wgVGVz\r\ndCBDQYIBADANBgkqhkiG9w0BA
QUFAAOCAQEAuP1U2ABUkIslsCfdl"
OK
AT+CTLSCFG=1,6,1344,0,"c2i94QHHYeJ\r\nSs //Configure TLS server CA.
www.simcom.com 9 / 10
SIM7020 Series_TLS_Application Note_V1.03
OK
//Create TLS connection
AT+CTLSCONN=1,1
Parameters
<tid>: 1
OK
<cid>:1
//Send data, parameters
AT+CTLSSEND=1,75,"GET <tid>:1
https://182.150.27.42/test.html <payload length>: 75
HTTP/1.1\r\nHost: 182.150.27.42\r\n\r\n" <payload>
OK //URC report
+CTLSSEND:1,69 <tid>:1
<ret>:69
AT+CTLSRECV=1,100,801
OK
//Receive data, parameters
+CTLSRECV:1,106,"HTTP/1.1 200 OK\r\nDate:
<tid>:1
Thu, 30 Nov 2017 11:16:24 GMT\r\nServer:
<data length>: 100 bytes
Apache/2.4.27
<code type>: 801 (string)
(Win32) OpenSSL/1.0.2l\r\n"
//Terminate TLS connection
Parameters,
AT+CTLSCLOSE=1
<tid>:1
OK
//URC report:
+CTLSCLOSE:1,1
<tid>:1
<ret>:1, means succeed
www.simcom.com 10 / 10