https://github.com/lab5e/libcoap-dtls-sample
CoAP over DTLS with libcoap
https://github.com/lab5e/libcoap-dtls-sample
coap cpp dtls firmware iot lang-c libcoap sample span
Last synced: 9 months ago
JSON representation
CoAP over DTLS with libcoap
- Host: GitHub
- URL: https://github.com/lab5e/libcoap-dtls-sample
- Owner: lab5e
- License: apache-2.0
- Created: 2022-03-29T10:55:54.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-25T12:13:30.000Z (almost 4 years ago)
- Last Synced: 2025-02-28T22:38:57.783Z (about 1 year ago)
- Topics: coap, cpp, dtls, firmware, iot, lang-c, libcoap, sample, span
- Language: C
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Libcoap sample client
This is a CoAP client sample for Raspberry Pi/Linux with the [libcoap](https://libcoap.net) library. This
sample uses the built-in transport layer included with the library.
This example builds on Linux/Raspberry Pi but should be relatively simple to port to other frameworks that
is built on top of the libcoap library such as ESP-IDF for the ESP32.
## Client certificate and private key
The sample code reads the certificate and private key from the files `cert.crt` and `key.pem`. Both files
must be PEM-encoded. The `cert.crt` contains the client certificate, intermediates and root and the `key.pem`
file contains the private key.
Use the [span CLI](https://github.com/lab5e/spancli) to generate a certificate and key file.
## Building
Install libcoap headers:
`sudo dnf install libcoap-devel`
Build with `make`