https://github.com/bocajim/dtls
This package implements a RFC-4347 compliant DTLS client and server. NOTE: This library is under active development and is not yet stable enough to be used in production.
- Pure go, no CGo
- Supports both client and server via UDP
- Supports TLS_PSK_WITH_AES_128_CCM_8 cipher RFC-6655
- Supports pre-shared key authentication, does not support certificate based authentication
- Designed for OMA LWM2M comliance LWM2M
- Implement alerting on key failures
- Implement session renegotiation
- Implement packet retransmission for handshake
- Implement out of order handshake processing
- Implement replay detection
- Implement client hello stateless cookie handling
- Improve parallel processing of incoming packets
Keystore
mks := keystore.NewMemoryKeyStore()
keystore.SetKeyStores([]keystore.KeyStore{mks})
psk, _ := hex.DecodeString("00112233445566")
mks.AddKey("myIdentity", psk)
Sample Client
listener, _ = NewUdpListener(":6000", time.Second*5)
peer, err := listener.AddPeer("127.0.0.1:5684", "myIdentity")
err = peer.Write("hello world")
data, rsp := listener.Read()
http://godoc.org/github.com/bocajim/dtls
MIT