|
| 1 | +# wolfSSL DTLS1.3 Project |
| 2 | + |
| 3 | +This is an example minimally viable wolfSSL template to get started with your own project. |
| 4 | + |
| 5 | +### Prerequisites |
| 6 | + |
| 7 | +It is assumed the [ESP-IDF environment](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/) has been installed. |
| 8 | + |
| 9 | +``` |
| 10 | +gcc -o client-dtls13 client-dtls13.c -L/mnt/c/workspace/wolfssl-gojimmypi/src/.libs -I/mnt/c/workspace/wolfssl-gojimmypi/ -I/mnt/c/workspace/wolfssl-gojimmypi/include -DWOLFSSL_TLS13 -DWOLFSSL_DTLS -DWOLFSSL_DTLS13 -DWOLFSSL_USER_SETTINGS -lwolfssl -ldl -lm |
| 11 | +``` |
| 12 | + |
| 13 | +### Files Included |
| 14 | + |
| 15 | +- [main.c](./main/main.c) with a simple call to an Espressif library (`ESP_LOGI`) and a call to a wolfSSL library (`esp_ShowExtendedSystemInfo`) . |
| 16 | + |
| 17 | +- See [components/wolfssl/include](./components/wolfssl/include/user_settings.h) directory to edit the wolfSSL `user_settings.h`. |
| 18 | + |
| 19 | +- Edit [main/CMakeLists.txt](./main/CMakeLists.txt) to add/remove source files. |
| 20 | + |
| 21 | +- The [components/wolfssl/CMakeLists.txt](./components/wolfssl/CMakeLists.txt) typically does not need to be changed. |
| 22 | + |
| 23 | +- Optional [VisualGDB Project](./VisualGDB/wolfssl_template_IDF_v5.1_ESP32.vgdbproj) for Visual Studio using ESP32 and ESP-IDF v5.1. |
| 24 | + |
| 25 | +- Edit the project [CMakeLists.txt](./CMakeLists.txt) to optionally point this project's wolfSSL component source code at a different directory: |
| 26 | + |
| 27 | +``` |
| 28 | +set(WOLFSSL_ROOT "~/workspace/wolfssl-other-source") |
| 29 | +``` |
| 30 | + |
| 31 | + |
| 32 | +## Getting Started: |
| 33 | + |
| 34 | +Here's an example using the command-line [idf.py](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-py.html). |
| 35 | + |
| 36 | +Edit your `WRK_IDF_PATH`to point to your ESP-IDF install directory. |
| 37 | + |
| 38 | +``` |
| 39 | +cd /mnt/C/workspace/wolfssl-gojimmypi/IDE/Espressif/ESP-IDF5/examples/wolfssl_dtls13_server |
| 40 | +
|
| 41 | +WRK_IDF_PATH=/mnt/c/SysGCC/esp32/esp-idf/v5.1 |
| 42 | +
|
| 43 | +echo "Run export.sh from ${WRK_IDF_PATH}" |
| 44 | +. ${WRK_IDF_PATH}/export.sh |
| 45 | +
|
| 46 | +# build the example: |
| 47 | +idf.py build |
| 48 | +
|
| 49 | +# flash the code onto the serial device at /dev/ttyS19 |
| 50 | +idf.py flash -p /dev/ttyS19 -b 115200 |
| 51 | +
|
| 52 | +# build, flash, and view UART output with one command: |
| 53 | +idf.py flash -p /dev/ttyS19 -b 115200 monitor |
| 54 | +
|
| 55 | +# erase |
| 56 | +idf.py erase-flash -p /dev/ttyS9 -b 115200 |
| 57 | +
|
| 58 | +# save defaults |
| 59 | +idf.py save-defconfig |
| 60 | +``` |
| 61 | + |
| 62 | +Press `Ctrl+]` to exit `idf.py monitor`. See [additional monitor keyboard commands](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-monitor.html). |
| 63 | + |
| 64 | +## Other Examples: |
| 65 | + |
| 66 | +For examples, see: |
| 67 | + |
| 68 | +- [TLS Client](../wolfssl_client/README.md) |
| 69 | +- [TLS Server](../wolfssl_server/README.md) |
| 70 | +- [Benchmark](../wolfssl_benchmark/README.md) |
| 71 | +- [Test](../wolfssl_test/README.md) |
| 72 | +- [wolfssl-examples](https://github.com/wolfSSL/wolfssl-examples/tree/master/ESP32) |
| 73 | +- [wolfssh-examples](https://github.com/wolfSSL/wolfssh-examples/tree/main/Espressif) |
| 74 | + |
| 75 | + |
| 76 | + |
0 commit comments