background image

 

HUAWEI MU509-b HSDPA LGA Module   
SSL Application Guide 

Configure SSL 

 

Issue 01 (2014-10-10) 

Huawei Proprietary and Confidential 

Copyright © Huawei Technologies Co., Ltd. 

14 

 

b3JlOiBPY3QgMjQgMTg6MjE6NTUgMjAxMSBHTVQKICAgICAgICAgICAgTm9
0IEFmdGVyIDogSnVsIDIwIDE4OjIxOjU1IDIwMTQgR01UCiAgICAgICAgU3Viam
VjdDogQz1VUywgU1Q9T3JlZ29uLCBMPVBvcnRsYW5kLCBPPXlhU1NMLCBP
VT1Qcm9ncmFtbWluZywgQ049d3d3Lnlhc3NsLmNvbS9lbWFpbEFkZHJlc3M9a
W5mb0B5YXNzbC5jb20KICAgICAgICBTdWJqZWN0IFB1YmxpYyBLZXkgSW5
mbzoKICAgICAgICAgICAgUHVibGljIEtleSBBbGdvcml0aG06IHJzYUVuY3J5cH
Rpb24KICAgICAgICAgICAgUlNBIFB1YmxpYyBLZXk6ICgyMDQ4IGJpdCkKICA
gICAgICAgICAgICAgIE1vZHVsdXMgKDIwNDggYml0KToKICAgICAgICAgICAgI
CAgICAgICAwMDpjMzowMzpkMToyYjpmZTozOTphNDozMjo0NTozYjo1MzpjO
Do4NDoyYjoKICAgICAgICAgICAgICAgICAgICAyYTo3Yzo3NDo5YTpiZDphYTo
yYTo" 

OK 

AT^SSLMNG=1,0,0,"client-
cert.pem",2,7,"1MjowNzo0NzpkNjphNjozNjpiMjowNzoKICAgICAgICAgICAgICAg
ICAgICAzMjo4ZTpkMDpiYTo2OTo3YjpjNjpjMzo0NDo5ZTpkNDo4MTo0ODpmZD
oyZDoKICAgICAgICAgICAgICAgICAgICA2ODphMjo4Yjo2NzpiYjphMTo3NTpjO
DozNjoyYzo0YTpkMjoxYjpmNzo4YjoKICAgICAgICAgICAgICAgICAgICBiYTpjZj
owZDpmOTplZjplYzpmMTo4MToxZTo3Yjo5YjowMzo0Nzo5YTpiZjoKICAgICAgI
CAgICAgICAgICAgICA2NTpjYzo3Zjo2NToyNDo2OTphNjplODoxNDo4OTo1Yjpl
NDozNDpmNzpjNToKICAgICAgICAgICAgICAgICAgICBiMDoxNDo5MzpmNTo2
Nzo3YjozYTo3YTo3ODplMTowMTo1Njo1Njo5MTphNjoKICAgICAgICAgICAgICA
gICAgICAxMzo0Mjo4ZDpkMjozYzo0MDo5Yzo0YzplZjpkMTo4NjpkZjozNzo1MTo
xYjoKICAgICAgICAgICAgICAgICAgICAwYzphMTozYjpmNTpmMTphMzo0YToz
NTplNDplMTpjZTo5NjpkZjoxYjo3ZToKICAgICAgICAgICAgICAgICAgICBiZjo0ZT
o5NzpkMDoxMDplODphODowODozMDo4MTphZjoyMDowYjo0MzoxNDoKICAg
ICAgICAgICAgICAgICAgICBjNTo3NDo2NzpiNDozMjo4Mjo2Zjo4ZDo4NjpjMjo4
ODo0MDo5OTozNjo4MzoKICAgICAgICAgICAgICAgICAgICBiYToxZTo0MDo3Mj
oyMjoxNzpkNzo1Mjo2NToyNDo3MzpiMDpjZTplZjoxOToKICAgICAgICAgICAgIC
AgICAgICBjZDphZTpmZjo3ODo2Yzo3YjpjMDoxMjowMzpkNDo0ZTo3MjowZDo
1MDo2ZDoKICAgICAgICAgICAgICAgIC" 

OK 

AT^SSLMNG=1,0,0,"client-
cert.pem",3,7,"AgICAzYjphMzozYjphMzo5OTo1ZTo5ZDpjODpkOTowYzo4NTpi
MzpkOTo4YTpkOToKICAgICAgICAgICAgICAgICAgICA1NDoyNjpkYjo2ZDpmYT
phYzpiYjpmZjoyNTo0YzpjNDpkMTo3OTpmNDo3MToKICAgICAgICAgICAgICAgI
CAgICBkMzo4Njo0MDoxODoxMzpiMDo2MzpiNTo3Mjo0ZTozMDpjNDo5Nzo4N
Do4NjoKICAgICAgICAgICAgICAgICAgICAyZDo1NjoyZjpkNzoxNTpmNzo3ZjpjM
DphZTpmNTpmYzo1YjplNTpmYjphMToKICAgICAgICAgICAgICAgICAgICBiYTp
kMwogICAgICAgICAgICAgICAgRXhwb25lbnQ6IDY1NTM3ICgweDEwMDAxKQ
ogICAgICAgIFg1MDl2MyBleHRlbnNpb25zOgogICAgICAgICAgICBYNTA5djMgU
3ViamVjdCBLZXkgSWRlbnRpZmllcjogCiAgICAgICAgICAgICAgICAzMzpEODo0
NTo2NjpENzo2ODo4NzoxODo3RTo1NDowRDo3MDoyNzo5MTpDNzoyNjpENz
o4NTo2NTpDMAogICAgICAgICAgICBYNTA5djMgQXV0aG9yaXR5IEtleSBJZGV
udGlmaWVyOiAKICAgICAgICAgICAgICAgIGtleWlkOjMzOkQ4OjQ1OjY2OkQ3O
jY4Ojg3OjE4OjdFOjU0OjBEOjcwOjI3OjkxOkM3OjI2OkQ3Ojg1OjY1OkMwCiAgI
CAgICAgICAgICAgICBEaXJOYW1lOi9DPVVTL1NUPU9yZWdvbi9MPVBvcnRs
YW5kL089eWFTU0wvT1U9UHJvZ3JhbW1pbmcvQ049d3d3Lnlhc3NsLmNvbS9l
bWFpbEFkZHJlc3M9aW5mb0B5YXNzbC5jb20KICAgICAgICAgICAgICAgIHNlc
mlhbDo4Nzo0QTo3NTpCRTo5MTo2NjpEODozRAoKICAgICAgICAgI" 

OK 

AT^SSLMNG=1,0,0,"client-
cert.pem",4,7,"CAgWDUwOXYzIEJhc2ljIENvbnN0cmFpbnRzOiAKICAgICAgICA
gICAgICAgIENBOlRSVUUKICAgIFNpZ25hdHVyZSBBbGdvcml0aG06IHNoYTF

Summary of Contents for MU509-b

Page 1: ...HUAWEI MU509 b HSDPA LGA Module V100R003 SSL Application Guide Issue 01 Date 2014 10 10 ...

Page 2: ...cations contained in this manual without prior notice and without any liability DISCLAIMER ALL CONTENTS OF THIS MANUAL ARE PROVIDED AS IS EXCEPT AS REQUIRED BY APPLICABLE LAWS NO WARRANTIES OF ANY KIND EITHER EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE MADE IN RELATION TO THE ACCURACY RELIABILITY OR CONTENTS OF ...

Page 3: ... Application Guide About This Document Issue 01 2014 10 10 Huawei Proprietary and Confidential Copyright Huawei Technologies Co Ltd 3 About This Document Revision History Document Version Date Chapter Descriptions 01 2014 10 10 Creation ...

Page 4: ... Configuring or Activating Context 6 2 3 SSL 7 2 3 1 Cipher Suites 8 2 3 2 Certificates 8 3 Configure SSL 9 3 1 Initialize SSL Library 9 3 2 Enable Secure CyaSSL Channel 9 3 3 Configure CyaSSL Socket 10 3 4 Manage Certificate 10 4 Work with SSL 18 4 1 Open a Secure Socket 18 4 2 Socket Connection Status 19 4 3 Exchange Data Through a Secure Socket 20 4 3 1 Transmit Data 20 4 3 2 Receive Data 20 4 ...

Page 5: ...owledge in wireless technology as well as in AT commands A basic knowledge of SSL and Transport Layer Security TLS security protocol is also needed For protocol details refer to RFC 2246 The TLS Protocol Version 1 0 For details about certificates refer to RFC 2459 X509v3 1 3 CyaSSL CyaSSL library is the third party SSL library for building security functionality into embedded devices with minimal ...

Page 6: ...ation of a PDP context is needed First of all context parameters have to be set They consist in a set of information identifying the internet entry point interface provided by the ISP This can be done using the AT CGDCONT command AT CGDCONT cid PDP_type APN PDP_addr d_comp h_com p Where cid the PDP Context Identifier a numeric parameter which specifies a particular PDP context definition PDP_type ...

Page 7: ...ntly Other values are reserved If no h_comp is included it is equivalent to the effect that the h_comp is 0 Example To configure APN AT CGDCONT 1 IP mhahuawei1 com OK To check the APN settings AT CGDCONT CGDCONT 1 IP mhahuawei1 com 0 0 OK To get the signal strength AT CSQ CSQ 28 99 OK 31 is the strongest 0 is the weakest and 99 for none To get the registered network AT COPS COPS 0 0 Terminal MHA N...

Page 8: ...e digests The supported cipher suites are listed below Value Cipher_suites 0 All supported Ciphers 1 TLS_RSA_WITH_RC4_128_SHA 2 TLS_RSA_WITH_RC4_128_MD5 3 TLS_RSA_WITH_NULL_SHA 4 TLS_RSA_WITH_NULL_SHA256 5 TLS_RSA_WITH_AES_256_CBC_SHA 6 TLS_RSA_WITH_AES_128_CBC_SHA 7 TLS_RSA_WITH_AES_128_CBC_SHA256 8 TLS_RSA_WITH_AES_256_CBC_SHA256 9 TLS_RSA_WITH_3DES_EDE_CBC_SHA 10 TLS_DHE_RSA_WITH_AES_256_CBC_SH...

Page 9: ...zed Once SSL service task is created CyaSSL library is initialized internally and a CyaSSL context is created 3 2 Enable Secure CyaSSL Channel The first step to be done in order to exchange data through an SSL socket is to enable the secure socket This can be done using the AT command AT SSLEN AT SSLEN SSL_id Enable Encode_ok Where SSL_id must be set to 1 for security socket ID available Enable in...

Page 10: ...o security data is needed at all 1 Server authentication mode CA Certificate storage is needed the most common case 2 Server or Client authentication mode CA Certificate server Certificate client and Private Key client are needed Example CyaSSL socket configuration AT SSLCFG 1 60 0 1 OK 3 4 Manage Certificate Certificate management can be done using the AT command AT SSLMNG AT SSLMNG SSL_id data_t...

Page 11: ...VZWE56YkM1amIyMHhIVEFiQmdrcWhra Uc5dzBCQ1FFV0RtbHVabTlBZVdGemMyd3VZMjl0TUI0WERURXgKTVRBeU5 ERTRNVGd4TlZvWERURTBNRGN5TURFNE1UZ3hOVm93Z1pBeEN6QUpCZ 05WQkFZVEFsVlRNUkF3RGdZRApWUVFJRXdkTmIyNTBZVzVoTVJBd0RnW URWUVFIRXdkQ2IzcGxiV0Z1TVJFd0R3WURWUVFLRXdoVFlYZDBiMjkwCmF ERVRNQkVHQTFVRUN4TUtRMjl1YzNWc2RHbHVaekVXTUJRR0ExVUVBeE1 OZDNkM0xubGhjM05zTG1OdmJURWQKTUJzR0NTcUdTSWIzRFFFSkFSWU9 hVzVtYjBCNVlYTnpiQzVqYjI...

Page 12: ...0aW5nLCBDTj13d3cueWFzc2wuY29tL2VtYWl sQWRkcmVzcz1pbmZvQHlhc3NsLmNvbQogICAgICAgIFN1YmplY3QgUHVibGlj IEtleSBJbmZvOgogICAgICAgICAgICBQdWJsaWMgS2V5IEFsZ29yaXRobTogcn NhRW5jcnlwdGlvbgogICAgICAgICAgICBSU0EgUHVibGljIEtleTogKDIwNDggYm l0KQogICAgICAgI OK AT SSLMNG 1 1 0 ca cert2 pem 4 7 CAgICAgICAgTW9kdWx1cyAoMjA0OCBiaXQpOgogICAgICAgI CAgICAgICAgICAgIDAwOmJmOjBjOmNhOjJkOjE0OmIyOjFlOjg0OjQyOjViOm NkOjM4OjFm...

Page 13: ...zoxYzo4OTo2Zjo5ZTplZTpiMzo5ZDo3NzozZTo4OToyM Do3NjphMzplNjoKICAgICAgICBlODo4NjoxNToyMTpkYjplMjozMzpiMjozNDpkNT pkMDo5ZjpmMzpjMTphNDo4Nzo5Mjo1YzoKICAgICAgICBmOTpkMTpmZjozMD oyZjo4ZTowMzpiYzpiMzozYzowYzozMjphMzo5MDo1ZjoxYTo5MDoxZToKICAgI CAgICBhZjo5ZDpmMzo5ZTpkNzowNzowMjphOTo3ZDoyNzo2Njo2MzoyZjphZjo xODpkNzphYzoxODoKICAgICAgICA5ODo4Yzo4Mzo4ZjozODpmMzowYjphYzo zNjoxMDo3NTpmYjpjYTo3NjoxMzo1MDo1YjowMjo...

Page 14: ...0YToz NTplNDplMTpjZTo5NjpkZjoxYjo3ZToKICAgICAgICAgICAgICAgICAgICBiZjo0ZT o5NzpkMDoxMDplODphODowODozMDo4MTphZjoyMDowYjo0MzoxNDoKICAg ICAgICAgICAgICAgICAgICBjNTo3NDo2NzpiNDozMjo4Mjo2Zjo4ZDo4NjpjMjo4 ODo0MDo5OTozNjo4MzoKICAgICAgICAgICAgICAgICAgICBiYToxZTo0MDo3Mj oyMjoxNzpkNzo1Mjo2NToyNDo3MzpiMDpjZTplZjoxOToKICAgICAgICAgICAgIC AgICAgICBjZDphZTpmZjo3ODo2Yzo3YjpjMDoxMjowMzpkNDo0ZTo3MjowZDo 1MDo2ZDoKICAg...

Page 15: ...ElGSUNBVEUtLS0tLQpN SUlFbURDQ0E0Q2dBd0lCQWdJSkFJZEtkYjZSWnRnOU1BMEdDU3FHU0liM0 RRRUJCUVVBTUlHT01Rc3dDUVlEClZRUU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ote_IP remote_port mode TimeOut Where SSL_id SSL socket ID 1 Secure socket connection 0 Normal socket connection remote_IP string type IP address IP or hostname of the server remote_port port the value ranges from 1 to 65535 remote port of the server usually 443 mode async mode optional it will take the value as 0 by default 0 Sync mode 1 Async mode For Sync mode data will be receiv...

Page 19: ...a GVsbG9oZWxsb2hlbGxvaGVsbG9oZWxsb2hlbGxvaGVsbG9oZWxsb2hlbGxva GVsbG9oZWxsb2hlbGxvaGVsbG9oZWxsb2hlbGxvaGVsbG9oZWxsb2hlbGxva GVsbG9oZWxsb2hlbGxvaGVsbG9oZWxsb2hlbGxvaGVsbG9oZWxsb2hlbGxva GVsbG9oZWxsb2hlbGxvaGVsbG9oZWxsb2hlbGxvaGVsbG9oZWxsb2hlbGxva GVsbG9oZWxsb2hlbGxvaGVsbG9oZWxsb2hlbGxvaGVsbG9oZWxsb2hlbGxva GU 4 2 Socket Connection Status An AT command is provided to know the current connection stat...

Page 20: ...pe the data which are needed to transmit 1 1024 bytes If the encode_ok is set to 1 then the input buffer should be 768 bytes of raw data If the encode_ok is set to 0 then the input buffer should be 1024 bytes of raw data If encode_ok in AT SSLEN command is 1 then it should be Base 64 encoded format data Otherwise it should be normal plain data TimeOut maximum blocking timeout in seconds It is an o...

Page 21: ...RX and for normal socket RX the default Timeout value 60 seconds will be used LengthOfRec the actual number of bytes received Received_data the received data If encode_ok in AT SSLEN command is 1 then it is Base 64 encoded format data the length of the Received_data is differ from LengthOfRec because the Received_data is in Base 64 encoded format Otherwise the actual plain data will be displayed E...

Page 22: ...o Requirement Description 1 AT SSLEN SSL_id Enable enc ode_ok Enable or disable a secure or normal socket 2 AT SSLCFG SSL_id TimeOut ciphe rs_suit scur_level Configure the properties of secure socket 3 AT SSLSTAT SSL_id Query the status of a secure or normal socket 4 AT SSLO SSL_id remote_IP re mote_port mode TimeOut Create and open a secure or normal socket 5 AT SSLTX SSL_id data_buffer TimeOut S...

Page 23: ...ted format Numerical Format AT CMEE 1 Verbose Format AT CMEE 2 100 Unknown Error 2101 Operations failed due to system error 2102 Socket not enabled 2103 Socket not connected 2104 Socket already enabled 2105 Socket already connected 2107 SSL error during handshake 2109 Fail to connect specified address 2110 Invalid arguments 2111 Certification error 2112 Invalid Operation 2113 Certificate maximum l...

Page 24: ...iations Acronym or Abbreviation Expansion CA Certification Authority FTP File Transfer Protocol GGSN Gateway GPRS Support Node HTTP Hypertext Transfer Protocol LDAP Lightweight Directory Access Protocol PDP Packet Data Protocol SMTP Simple Mail Transfer Protocol REX Real Time Executive SSL Secure Socket Layer TCP Transmission Control Protocol TLS Transport Layer Security ...

Reviews: