SIM7020 Series - TLS - Application Note - V1.03

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

imai

SIM7020 Series_TLS
_Application Note
LPWA Module

SIMCom Wireless Solutions Limited


Building B, SIM Technology Building, No.633, Jinzhong Road
Changning District, Shanghai P.R. China
Tel: 86-21-31575100
[email protected]
www.simcom.com
SIM7020 Series_TLS_Application Note_V1.03

Document Title: SIM7020 Series_TLS_Application Note


Version: 1.03
Date: 2020.6.10
Status: Release

GENERAL NOTES

SIMCOM OFFERS THIS INFORMATION AS A SERVICE TO ITS CUSTOMERS, TO SUPPORT


APPLICATION AND ENGINEERING EFFORTS THAT USE THE PRODUCTS DESIGNED BY SIMCOM.
THE INFORMATION PROVIDED IS BASED UPON REQUIREMENTS SPECIFICALLY PROVIDED TO
SIMCOM BY THE CUSTOMERS. SIMCOM HAS NOT UNDERTAKEN ANY INDEPENDENT SEARCH
FOR ADDITIONAL RELEVANT INFORMATION, INCLUDING ANY INFORMATION THAT MAY BE IN THE
CUSTOMER’S POSSESSION. FURTHERMORE, SYSTEM VALIDATION OF THIS PRODUCT
DESIGNED BY SIMCOM WITHIN A LARGER ELECTRONIC SYSTEM REMAINS THE RESPONSIBILITY
OF THE CUSTOMER OR THE CUSTOMER’S SYSTEM INTEGRATOR. ALL SPECIFICATIONS
SUPPLIED HEREIN ARE SUBJECT TO CHANGE.

COPYRIGHT

THIS DOCUMENT CONTAINS PROPRIETARY TECHNICAL INFORMATION WHICH IS THE PROPERTY


OF SIMCOM WIRELESS SOLUTIONS LIMITED COPYING, TO OTHERS AND USING THIS DOCUMENT,
ARE FORBIDDEN WITHOUT EXPRESS AUTHORITY BY SIMCOM. OFFENDERS ARE LIABLE TO THE
PAYMENT OF INDEMNIFICATIONS. ALL RIGHTS RESERVED BY SIMCOM IN THE PROPRIETARY
TECHNICAL INFORMATION ,INCLUDING BUT NOT LIMITED TO REGISTRATION GRANTING OF A
PATENT , A UTILITY MODEL OR DESIGN. ALL SPECIFICATION SUPPLIED HEREIN ARE SUBJECT TO
CHANGE WITHOUT NOTICE AT ANY TIME.

SIMCom Wireless Solutions Limited


Building B, SIM Technology Building, No.633 Jinzhong Road, Changning District, Shanghai P.R. China
Tel: +86 21 31575100
Email: [email protected]

For more information, please visit:


https://www.simcom.com/download/list-863-en.html

For technical support, or to report documentation errors, please visit:


https://www.simcom.com/ask/ or email to: [email protected]

Copyright © 2020 SIMCom Wireless Solutions Limited All Rights Reserved.

www.simcom.com 2 / 10
SIM7020 Series_TLS_Application Note_V1.03

About Document

Version History

Version Date Owner What is new


V1.00 2018.4.12 Chengliang.Wang First Release
V1.01 2018.6.8 Ruihu.Yu
V1.02 2019.12.10 Chengliang.Wang Add DTLS Application
V1.03 2020.6.10 Wenjie.Lai All

Scope

This document applies to the following products

Name Type Size(mm) Comments


SIM7020C NB1 17.6*15.7 Band 1/3/5/8
SIM7020E NB1 17.6*15.7 Band 1/3/5/8/20/28
SIM7030 NB1 16*18 Band 1/3/5/8
SIM7060 NB1+GNSS 24*24 Band 5/8
SIM7020G NB2 17.6*15.7 Band 1/2/3/4/5/8/12/13/17/18/19/20/25/26/28/66/70/71/85
SIM7060G NB2+GNSS 24*24 Band 1/2/3/4/5/8/12/13/17/18/19/20/25/26/28/66/70/71/85

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

2 TLS Introduction .............................................................................................................. 6


3 Bearer Configuration ....................................................................................................... 7
3.1 PDN Auto-activation .................................................................................................................... 7
3.2 APN Manual configuration .......................................................................................................... 7

4 TLS Examples .................................................................................................................. 9

www.simcom.com 4 / 10
SIM7020 Series_TLS_Application Note_V1.03

1 Introduction

1.1 Purpose of the document

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.

1.2 Related documents

[1] SIM7020 Series_AT Command Manual

1.3 Conventions and abbreviations

In this document, the GSM engines are referred to as following term:


ME (Mobile Equipment);
MS (Mobile Station);
TA (Terminal Adapter);
DCE (Data Communication Equipment) or facsimile DCE (FAX modem, FAX board);

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.

SIM7020 series modules currently support TLS1.0, TLS1.1, TLS1.2.

www.simcom.com 6 / 10
SIM7020 Series_TLS_Application Note_V1.03

3 Bearer Configuration
Usually module will register PS service automatically.

3.1 PDN Auto-activation

//Example of PDN Auto-activation.

AT+CPIN? // Check SIM card status


+CPIN: READY

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

3.2 APN Manual configuration

www.simcom.com 7 / 10
SIM7020 Series_TLS_Application Note_V1.03

//Example of APN Manual configuration.

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

//Configure TLS server instance, parameters


AT+CTLSCFG=1,1,"182.150.27.42",2,50090,3,0,
include, <tid>:1 ;<server name>: 1; server ip:
4,0,5,2
182.150.27.42; <prot>: 2; <port>: 50090; <socket
type>:3 for 0 –tcp; <Authentication mode>: 4,
OK
value is 0-none; <debug level> : 5, value is 2.
AT+CTLSCFG=1,6,1344,1,"-----BEGIN
CERTIFICATE-----\r\nMIIDhzCCAm+gAwIBAgIB
ADANBgkqhkiG9w0BAQUFADA7MQswCQYDV
QQGEwJOTDER\r\nMA8GA1UEChMIUG9sYXJ
TU0wxGTAXBgNVBAMTEFBvbGFyU1NMIFRlc
3QgQ0EwHhcN\r\nMTEwMjEyMTQ0NDAwWhc
NMjEwMjEyMTQ0NDAwWjA7MQswCQYDVQQ
GEwJOTDERMA8G\r\nA1UEChMIUG9sYXJTU0
wxGTAXBgNVBAMTEFBvbGFyU1NMIFRlc3Qg
Q0EwggEiMA0G\r\nCSqGSIb3DQEBAQUAA4IB
DwAwggEKAoIBAQDA3zf8F7vglp0/ht6WMn1E
pRagzSHx\r\nmdTs6st8GFgIlKXsm8WL3xoemT
iZhx57wI053zhdcHgH057Zk+i5clHFzqMwUqny\
r\n50BwFMtEonILwuVA+T7lpg6z+exKY8C4KQ
B0nFc7qKUEk"

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

R4EdgHtdciUI5I62J6Mom+Y0dT/7a+8S6MVMC No more input after this.


ZP6C5NyNyXw1GWY/YR82XTJ8H\r\nDBJiCTok
5DbZ6SzaONBzdWHXwWwmi5vg1dxn7YxrM9d
0IjxM27WNKs4sDQhZBQkF\r\npjmfs2cb4oPl4Y
9T9meTx/lvdkRYEug61Jfn6cA+qHpyPYdTH+U
shITnmp5/Ztkf\r\nm/UTSLBNFNHesiTZeH31Nc
xYGdHSme9Nc/gfidRa0FLOCfWxRlFqAI47zG9j
AQCZ\r\n7Z2mCGDNMhjQc+BYcdnl0lPXjdDK6
V0qCg1dVewhUBcW5gZKzV7e9+DpVA==\r\n---
--END CERTIFICATE-----"

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

You might also like