Skip to content

Commit f3ca7e5

Browse files
juhaylinenrlubos
authored andcommitted
samples: crypto: improve psa_tls documentation
Add note how to start openssl client/server with DTLS connection. Signed-off-by: Juha Ylinen <[email protected]>
1 parent cb54b39 commit f3ca7e5

File tree

1 file changed

+81
-5
lines changed

1 file changed

+81
-5
lines changed

samples/crypto/psa_tls/README.rst

Lines changed: 81 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ After programming the sample to your development kit, complete the following ste
132132

133133
.. tabs::
134134

135-
.. tab:: Test the sample as a server
135+
.. tab:: Server test
136136

137137
1. Start a terminal emulator like nRF Connect Serial Terminal and connect to the used serial port with the standard UART settings.
138138
See :ref:`test_and_optimize` for more information.
@@ -168,18 +168,18 @@ After programming the sample to your development kit, complete the following ste
168168
#. Check in the terminal emulator that 21 bytes were successfully received and returned.
169169

170170

171-
.. tab:: Test the sample as a client
171+
.. tab:: Client test
172172

173173
1. Start a terminal emulator like nRF Connect Serial Terminal and connect to the used serial port with the standard UART settings.
174174
See :ref:`test_and_optimize` for more information.
175175
#. Observe the logs from the application using the terminal emulator.
176-
#. Start the ``eth_rtt_link`` executable as superuser with your development kit's segger-id and the following IPv4 address as parameters:
176+
#. Start the ``eth_rtt_link`` executable as a superuser with your development kit's SEGGER ID and the following IPv4 address as parameters:
177177

178178
.. code-block:: console
179179
180180
sudo ./eth_rtt_link --snr 960010000 --ipv4 192.0.2.1
181181
182-
#. Use ``openssl`` to perform the `client` connection and handshake operation.
182+
#. Use ``openssl`` to start the server, which waits for the `client` connection and handshake operation.
183183

184184
.. code-block:: console
185185
@@ -199,7 +199,83 @@ After programming the sample to your development kit, complete the following ste
199199
200200
openssl ciphers
201201
202-
#. Type ``Nordic Semiconductor`` into the ``openssl`` connection session to send the string ``Nordic Semiconductor`` as an encrypted message to the server.
202+
#. Type ``Nordic Semiconductor`` into the ``openssl`` connection session to send ``Nordic Semiconductor`` as an encrypted message to the client.
203+
#. Check that the TLS sample returns ``Nordic Semiconductor`` in the ``openssl`` session.
204+
#. Check in the terminal emulator that 21 bytes were successfully received and returned.
205+
206+
207+
.. tab:: DTLS server test
208+
209+
Use ``dtls.conf`` overlay when building the sample to enable DTLS support.
210+
211+
1. Start a terminal emulator like nRF Connect Serial Terminal and connect to the used serial port with the standard UART settings.
212+
See :ref:`test_and_optimize` for more information.
213+
#. Observe the logs from the application using the terminal emulator.
214+
#. Start the ``eth_rtt_link`` executable as a superuser with your development kit's SEGGER ID and the following IPv4 address as parameters:
215+
216+
.. code-block:: console
217+
218+
sudo ./eth_rtt_link --snr 960010000 --ipv4 192.0.2.2
219+
220+
#. Use ``openssl`` to perform the `client` connection and handshake operation.
221+
222+
.. code-block:: console
223+
224+
openssl s_client -dtls -connect 192.0.2.1:4243 -cipher ECDHE-ECDSA-AES128-SHA256 -CAfile certs/ecdsa/root_cert.pem
225+
226+
.. note::
227+
228+
If the sample has been built with an RSA certificate, use this ``openssl`` command:
229+
230+
.. code-block:: console
231+
232+
openssl s_client -dtls -connect 192.0.2.1:4243 -cipher AES128-SHA256 -CAfile certs/rsa/root_cert.pem
233+
234+
For visualizing a list of the available cipher suites for openssl, use the following command:
235+
236+
.. code-block:: console
237+
238+
openssl ciphers
239+
240+
#. Type ``Nordic Semiconductor`` into the ``openssl`` connection session to send ``Nordic Semiconductor`` as an encrypted message to the server.
241+
#. Check that the TLS sample returns ``Nordic Semiconductor`` in the ``openssl`` session.
242+
#. Check in the terminal emulator that 21 bytes were successfully received and returned.
243+
244+
245+
.. tab:: DTLS client test
246+
247+
Use ``dtls.conf`` overlay when building the sample to enable DTLS support.
248+
249+
1. Start a terminal emulator like nRF Connect Serial Terminal and connect to the used serial port with the standard UART settings.
250+
See :ref:`test_and_optimize` for more information.
251+
#. Observe the logs from the application using the terminal emulator.
252+
#. Start the ``eth_rtt_link`` executable as a superuser with your development kit's SEGGER ID and the following IPv4 address as parameters:
253+
254+
.. code-block:: console
255+
256+
sudo ./eth_rtt_link --snr 960010000 --ipv4 192.0.2.1
257+
258+
#. Use ``openssl`` to start the server, which waits for the `client` connection and handshake operation.
259+
260+
.. code-block:: console
261+
262+
openssl s_server -dtls -accept 4243 -cipher ECDHE-ECDSA-AES128-SHA256 -cert certs/ecdsa/cert.pem -key certs/ecdsa/cert.key
263+
264+
.. note::
265+
266+
If the sample has been built with an RSA certificate, use this ``openssl`` command:
267+
268+
.. code-block:: console
269+
270+
openssl s_server -dtls -accept 4243 -cipher AES128-SHA256 -cert certs/rsa/cert.pem -key certs/rsa/cert.key
271+
272+
For visualizing a list of the available cipher suites for openssl, use the following command:
273+
274+
.. code-block:: console
275+
276+
openssl ciphers
277+
278+
#. Type ``Nordic Semiconductor`` into the ``openssl`` connection session to send ``Nordic Semiconductor`` as an encrypted message to the client.
203279
#. Check that the TLS sample returns ``Nordic Semiconductor`` in the ``openssl`` session.
204280
#. Check in the terminal emulator that 21 bytes were successfully received and returned.
205281

0 commit comments

Comments
 (0)