Reference Manual

Table Of Contents
10.2. TCP communication
Refer to section
4.5
for detailed description of creating a TCP server and client and data
exchange between them.
10.3. Secure socket communication
SSL/TLS layer provides added security features like server authentication and end-to-end
encryption. This exampled describes creation of an SSL/TLS server as well as client on
Calypso EV board and exchange of data between the two.
The following hardware is required to go through the quick start example.
1. Two Calypso evaluation boards.
2. An IEEE 802.11b/g/n compatible access point working in the 2.4 GHz band.
3. Computer with a serial terminal emulator like Tera Term.
4. Server certificate and key stored on the sFlash of the server module.
Assuming that the EV boards have the hardware configuration as described in section
4.5.2
,
the next step in the process is to connect both the EV boards to the AP as described in
section
4.5.5
. In this example, the modules have the IP addresses 192.168.1.169 (SSL/TLS
client) and 192.168.1.140 (SSL/TLS server).
10.3.1. Create an SSL/TLS server
The module with IP address 192.168.1.140 is configured as SSL/TLS server.
1. Create a simple TCP socket with the following command. Note the socket ID for future
reference.
AT+socket=INET ,STREAM,TCP
+socket :0
2. The next step is to upgrade the socket to secure by updating the socket options.
AT+setSockOpt =0 , socket , secmethod , SSLV3_TLSV1_2
OK
3. The SSL/TLS server needs a certificate and the corresponding private key to be s-
tored on sFlash. In this case the certificate "dummy-trusted-cert" and the key "dummy-
trusted-cert-key" are already present in the file system and configured to be used by
the SSL server as shown.
AT+setSockOpt =0 , socket , SECURE_FILES_PRIVATE_KEY_FILE_NAME, dummytrusted
cert key
OK
AT+setSockOpt =0 , socket , SECURE_FILES_CERTIFICATE_FILE_NAME,dummytruste d
c e r t
OK
4. Finally, bind the socket to a port (in this example 9999) and the local IP address and
listen for connection requests.
Calypso reference manual version 1.2 © April 2019
www.we-online.com/wireless-connectivity 81