wolfssl-examples/tls
Devin AI a74868a6e0 Add comprehensive documentation for example requirements
- Add configuration requirements for each example
- Document hardware dependencies for UART examples
- Add troubleshooting guide
- Categorize examples by functionality
- Add TLS 1.3 resume certificate requirements

Co-Authored-By: eric@wolfssl.com <eric@wolfssl.com>
2025-02-18 21:08:35 +00:00
..
VisualGDB-tls whitespace & project cleanup 2022-06-03 16:29:12 -07:00
Makefile Peer review feedback. 2024-01-10 15:05:48 -08:00
README.md Add comprehensive documentation for example requirements 2025-02-18 21:08:35 +00:00
client-ech-local.c add examples for setting up an ech server and 2023-07-04 06:17:33 -04:00
client-ech.c add example of how to use HPKE with all options (#356) 2023-07-10 14:25:20 -07:00
client-tcp.c Adding documentation where needed. Made changes to code to assure files build and implement good coding practices 2021-06-29 16:02:52 -06:00
client-tls-bio.c Getting files to run and pass nightly-CDT test 2021-07-06 13:57:19 -06:00
client-tls-cacb.c Support building TLS examples with `--disable-oldnames`. 2023-12-19 10:35:55 -08:00
client-tls-callback.c Getting files to run and pass nightly-CDT test 2021-07-06 13:57:19 -06:00
client-tls-cryptocb.c Peer review cleanups 2. 2024-01-10 17:26:55 -08:00
client-tls-ecdhe.c Support building TLS examples with `--disable-oldnames`. 2023-12-19 10:35:55 -08:00
client-tls-nonblocking.c Revert "Tls client: fix bad comparison for non-blocking shutdown call." 2022-07-20 16:25:22 -07:00
client-tls-perf.c Spelling fixes. 2021-06-09 09:07:40 -07:00
client-tls-pkcallback.c Peer review feedback. 2022-03-21 14:17:31 -07:00
client-tls-pkcs12.c Getting files to run and pass nightly-CDT test 2021-07-06 13:57:19 -06:00
client-tls-resume.c Update client-tls-resume example with latest wolfSSL API 2025-02-18 18:25:41 +00:00
client-tls-uart.c Support building TLS examples with `--disable-oldnames`. 2023-12-19 10:35:55 -08:00
client-tls-writedup.c Getting files to run and pass nightly-CDT test 2021-07-06 13:57:19 -06:00
client-tls.c Support building TLS examples with `--disable-oldnames`. 2023-12-19 10:35:55 -08:00
client-tls13-resume.c Fix enable session ticket hint 2023-08-15 08:12:16 -07:00
client-tls13.c Peer review feedback fixes. 2022-02-22 13:45:10 -08:00
cryptocb-common.c Peer review feedback. 2024-01-10 15:05:48 -08:00
cryptocb-common.h Peer review feedback. 2024-01-10 15:05:48 -08:00
memory-tls.c Support building TLS examples with `--disable-oldnames`. 2023-12-19 10:35:55 -08:00
server-ech-local.c switch to using external base64 encoding for the ech config 2023-07-06 19:22:32 -04:00
server-tcp.c Adding documentation where needed. Made changes to code to assure files build and implement good coding practices 2021-06-29 16:02:52 -06:00
server-tls-callback.c Support building TLS examples with `--disable-oldnames`. 2023-12-19 10:35:55 -08:00
server-tls-cryptocb.c Peer review cleanups 2. 2024-01-10 17:26:55 -08:00
server-tls-ecdhe.c Support building TLS examples with `--disable-oldnames`. 2023-12-19 10:35:55 -08:00
server-tls-epoll-perf.c Spelling fixes. 2021-06-09 09:07:40 -07:00
server-tls-epoll-threaded.c Spelling fixes. 2021-06-09 09:07:40 -07:00
server-tls-nonblocking.c Support building TLS examples with `--disable-oldnames`. 2023-12-19 10:35:55 -08:00
server-tls-pkcallback.c Phase 1 updates to wolfSSL examples based on testing with wolfSSL 2023-03-25 09:15:11 -05:00
server-tls-poll-perf.c Implement a TLS perf server with poll system call. 2022-07-25 11:43:05 +00:00
server-tls-threaded.c Support building TLS examples with `--disable-oldnames`. 2023-12-19 10:35:55 -08:00
server-tls-uart.c Support building TLS examples with `--disable-oldnames`. 2023-12-19 10:35:55 -08:00
server-tls-verifycallback.c Phase 1 updates to wolfSSL examples based on testing with wolfSSL 2023-03-25 09:15:11 -05:00
server-tls-writedup.c Phase 1 updates to wolfSSL examples based on testing with wolfSSL 2023-03-25 09:15:11 -05:00
server-tls.c Peer review feedback. 2024-01-10 15:05:48 -08:00
server-tls13.c Peer review feedback fixes. 2022-02-22 13:45:10 -08:00
uart_requirements.md Add comprehensive documentation for example requirements 2025-02-18 21:08:35 +00:00

README.md

wolfSSL TLS Example Applications

This directory contains example applications demonstrating various wolfSSL TLS features.

Building the Examples

make

Configuration Requirements

Some examples require specific wolfSSL configuration options:

PKCallback Examples (client-tls-pkcallback, server-tls-pkcallback)

  • Requires: --enable-pkcallbacks
  • Purpose: Enable public key callback functionality
  • Error if not enabled: "PK not compiled in"

TLS BIO and PKCS12 Examples (client-tls-bio, client-tls-pkcs12)

  • Requires: --enable-opensslextra and --enable-des3
  • Purpose: OpenSSL compatibility layer and DES3 for PKCS12
  • Error if not enabled: "requires --enable-opensslextra" or "wolfSSL not configured with --enable-des3"

CryptoCB Examples (client-tls-cryptocb, server-tls-cryptocb)

  • Requires: --enable-cryptocb
  • Purpose: Enable crypto callback interface
  • Error if not enabled: "Please configure wolfSSL with --enable-cryptocb"

WriteUp Examples (client-tls-writedup, server-tls-writedup)

  • Requires: --enable-writedup
  • Purpose: Enable file descriptor duplication
  • Error if not enabled: "wolfSSL not configured with --enable-writedup"

ECH Examples (client-ech, server-ech-local)

  • Requires: --enable-ech
  • Purpose: Enable Encrypted Client Hello support
  • Error if not enabled: "Please build wolfssl with --enable-ech"

TLS 1.3 Resume Example (client-tls13-resume)

  • Requires: Client certificates (same as client-tls13)
  • Files needed:
    • CERT_FILE: "../certs/client-cert.pem"
    • KEY_FILE: "../certs/client-key.pem"
    • CA_FILE: "../certs/ca-cert.pem"

Hardware Dependencies

UART Examples (client-tls-uart, server-tls-uart)

See UART Requirements for detailed setup instructions.

  • Requires physical UART hardware
  • Device must be accessible at /dev/ttyUSB0
  • Cannot be tested in virtual environments

Troubleshooting

  1. Missing Configuration
# Configure wolfSSL with all required features
cd ~/repos/wolfssl
./configure --enable-pkcallbacks \
           --enable-opensslextra \
           --enable-cryptocb \
           --enable-des3 \
           --enable-writedup \
           --enable-ech
make
sudo make install
  1. Certificate Issues
  • Ensure all required certificates are in ../certs/ directory
  • Check file permissions
  • Verify certificate paths in example code
  1. Hardware Issues
  • For UART examples, verify hardware connection
  • Check device permissions
  • Use alternative examples for testing when hardware is unavailable

Example Categories

  1. Basic TLS Examples
  • client-tls / server-tls
  • client-tls13 / server-tls13
  1. Session Resumption
  • client-tls-resume (TLS 1.2)
  • client-tls13-resume (TLS 1.3)
  1. Callback Examples
  • client-tls-callback / server-tls-callback
  • client-tls-cryptocb / server-tls-cryptocb
  • client-tls-pkcallback / server-tls-pkcallback
  1. Performance Examples
  • client-tls-perf
  • server-tls-epoll-perf
  • server-tls-poll-perf
  1. Special Features
  • client-tls-ecdhe / server-tls-ecdhe
  • client-tls-nonblocking / server-tls-nonblocking
  • client-tls-writedup / server-tls-writedup
  • memory-tls