| Electronic Components Datasheet Search |
|
AN4683 Datasheet(PDF) 20 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN4683 Datasheet(HTML) 20 Page - STMicroelectronics |
|
20 / 31 page ![]() Demonstration package AN4683 20/31 DocID027745 Rev 1 When WIND:55 indications occur, the pending data is still encrypted, thus the length of decrypted data is not known in advance. The SOCKQ can be used to get the actual length of the data decrypted by TLS library and already waiting for reading. Up to 4 consecutive WIND:55 messages (w/o SOCKR) are guaranteed. To prevent data loss, it is suggested to empty the buffer by using the AT+S.SOCKR command and to avoid exceeding 4 indications. AT+S.SOCKW=<sock id>,<len> AT+S.SOCKQ=<sock id> AT+S.SOCKR=<sock id>,<len> Note: When using a secure socket, the module can handle data packets up to 3 KB. This means that the len parameter in AT+S.SOCKW and AT+S.SOCKR can be up to 3072 bytes. Detailed description of AT commands is contained in (see [2] in References). 3.4 Example 2: TLS Client with one-way authentication This second example implements a TLS connection supporting one-way authentication. The server and CA use RSA-2048 authentication. Before running the example, the SPWF01Sxxx (client) must be connected to the Wi-Fi LAN as illustrated in Section 3.2 and OpenSSL must be installed on the PC (acting as server). For testing purposes, OpenSSL-1.0.1i has been used as TLS Server. Documentation and installation instructions are available on the OpenSSL website (see [12] in References). The IP addresses of the client and server are automatically assigned by the network router. To start the server, open a command prompt into the folder Project/Examples/Example2 and run this line: openssl s_server -cert server_cert.pem -key server_key.pem -accept <port> Note: The accept parameter specifies the TCP port to listen on for connections. If not specified, the default 4433 is used. To start the client, it's recommended to run AT+S.TLSCERT2=clean,all to clean the Flash memory, and then use these AT commands: AT+S.SETTIME=<seconds> AT+S.TLSCERT=f_ca,<size><CR><data> AT+S.TLSDOMAIN=f_domain,<server domain> AT+S.SOCKON=<hostname>,<port>,s[,ind] Note: Seconds is the current time expressed in seconds since 1970-Jan-01: AT+S.SETTIME can be done only once after module reset. AT+S.TLSCERT=<f_ca/f_cert/f_key>,<size><CR><data> stores certificates or key files to the module. In case of one-way authentication, only the CA certificate (f_ca) must be loaded, the data must be in PEM format. This command accepts data after the <CR> at the end of the command line. The host is expected to supply <size> of data as last parameter of the command line. The size values must be expressed in bytes. AT+S.TLSDOMAIN=f_domain,<server domain> passes the server domain to the module and stores the domain information to Flash memory. The server domain is a string of |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |