Skip to content

Commit 21daac5

Browse files
krish2718dkalowsk
authored andcommitted
doc: wifi: Add certificate generation instructions
Add clear, step-by-step guide for generating test certificates using FreeRADIUS scripts, including file renaming and usage notes. Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
1 parent 0ec2f5a commit 21daac5

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

doc/connectivity/networking/api/wifi.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,54 @@ Any AAA server can be used for testing purposes, for example, ``FreeRADIUS`` or
115115

116116
When using TLS credentials subsystem, by default the volatile backend i.e., :kconfig:option:`CONFIG_TLS_CREDENTIALS_BACKEND_VOLATILE` is chosen. When using the volatile backend, the certificates are stored in RAM and are lost on reboot, so the certificates need to be installed again after reboot. As an alternative, the PS (protected storage) backend i.e., :kconfig:option:`CONFIG_TLS_CREDENTIALS_BACKEND_PROTECTED_STORAGE` can be used to store the certificates in the non-volatile storage.
117117

118+
How to Generate Test Certificates Using FreeRADIUS
119+
--------------------------------------------------
120+
121+
The test certificates in ``samples/net/wifi/test_certs/rsa2k`` are generated using the `FreeRADIUS raddb/certs scripts <https://github.com/FreeRADIUS/freeradius-server/tree/master/raddb/certs>`_. You can generate your own certificates for testing as follows:
122+
123+
1. **Prerequisites**
124+
- Install OpenSSL and GNU Make.
125+
- Download the `FreeRADIUS raddb/certs directory <https://github.com/FreeRADIUS/freeradius-server/tree/master/raddb/certs>`_.
126+
127+
2. **Edit the Makefile**
128+
In the ``raddb/certs`` directory, edit the ``Makefile`` to add ``-nodes`` to the OpenSSL commands for server and client keys. This ensures the private keys are not password-protected (Zephyr Wi-Fi shell does not support private key passwords):
129+
130+
::
131+
132+
$(OPENSSL) req -new -out server.csr -keyout server.key -nodes -config ./server.cnf
133+
$(OPENSSL) req -new -out client.csr -keyout client.key -nodes -config ./client.cnf
134+
135+
3. **(Optional) Edit the .cnf files**
136+
Customize ``server.cnf`` and ``client.cnf`` as needed for your environment.
137+
138+
4. **Generate Certificates**
139+
Run the following commands in the ``raddb/certs`` directory:
140+
141+
::
142+
143+
make destroycerts
144+
make server
145+
make client
146+
147+
5. **Rename Files for Zephyr**
148+
Match the filenames used in Zephyr samples:
149+
150+
+-------------------+---------------------+
151+
| FreeRADIUS Output | Zephyr Sample Name |
152+
+===================+=====================+
153+
| ca.pem | ca.pem |
154+
| server.key | server-key.pem |
155+
| server.pem | server.pem |
156+
| client.key | client-key.pem |
157+
| client.pem | client.pem |
158+
+-------------------+---------------------+
159+
160+
6. **Copy the files**
161+
Place the renamed files in your Zephyr project's certificate directory (e.g., ``samples/net/wifi/test_certs/rsa2k``).
162+
163+
.. note::
164+
These certificates are for testing only and should not be used in production.
165+
118166
API Reference
119167
*************
120168

doc/releases/release-notes-4.2.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ New APIs and options
189189
* Wi-Fi
190190

191191
* :kconfig:option:`CONFIG_WIFI_USAGE_MODE`
192+
* Added a new section to the Wi-Fi Management documentation (``doc/connectivity/networking/api/wifi.rst``) with step-by-step instructions for generating test certificates for Wi-Fi using FreeRADIUS scripts. This helps users reproduce the process for their own test environments.
192193

193194
* Power management
194195

0 commit comments

Comments
 (0)