You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Integrate DTLS (pion/dtls) configuration using options instead of deprecated *dtls.Config{} (#645)
* chore: update Go version and pion/dtls in go.mod and go.sum
* feat: introduce options-based DTLS API and deprecate legacy methods
* feat: refactor DTLS API to use generic options-based configuration and deprecate legacy methods
* feat: update DTLS implementation to use options-based configuration across examples
* test: enhance error assertion in TestTLSListenerCheckForInfinitLoop for macOS compatibility
* docs: update README to reflect deprecation of *dtls.Config and introduce options-based DTLS API
* fix: ensure DTLS connection is closed on error in Dial function
* feat: update README and add example client for options-based DTLS API
* fix: clean up main function in DTLS client example
* fix: update indirect dependencies to latest versions
@@ -116,6 +124,43 @@ The go-coap provides servers and clients for DTLS, TCP-TLS, UDP, TCP in golang l
116
124
}
117
125
```
118
126
127
+
### DTLS Options-based API (pion/dtls v3)
128
+
129
+
> **Deprecation notice:**`*dtls.Config` is [deprecated in pion/dtls v3](https://github.com/pion/dtls) in favour of immutable options-based configurations. Its use in go-coap is consequently deprecated as well and may be removed in a future major version. Migrate to `net.NewDTLSServerOptions` / `dtls.NewDTLSClientOptions` as shown below.
130
+
131
+
In addition to the legacy `*dtls.Config`, go-coap supports the **options-based API** introduced in pion/dtls v3. Both approaches are currently accepted by the same generic functions (`ListenAndServeDTLS`, `Dial`, `NewDTLSListener`).
132
+
133
+
Use `net.NewDTLSServerOptions(...)` / `dtls.NewDTLSClientOptions(...)` to compose DTLS configurations from individual options:
See [examples/options/server/](examples/options/server/) and [examples/options/client/](examples/options/client/) for complete working examples using the options-based API.
0 commit comments