Skip to content
DTLS 1.0 client/server in go, fork of bocajim/dtls
Branch: master
Clone or download
Pull request Compare This branch is 2 commits ahead of bocajim:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ccm
.gitignore
.travis.yml
LICENSE
README.md
alert.go
bytereader.go
bytewriter.go
common.go
crypto.go
crypto_test.go
debug.go
dtls.go
dtls_test.go
handshake.go
handshake_clienthello.go
handshake_clientkeyexchange.go
handshake_finished.go
handshake_header.go
handshake_helloverifyrequest.go
handshake_serverhello.go
handshake_serverhellodone.go
handshake_serverkeyexchange.go
handshake_test.go
handshake_unknown.go
keystore.go
log.go
peer.go
record.go
record_test.go
session.go
session_cache.go
session_handshake.go
session_test.go
transport.go
transport_udp.go

README.md

dtls

This is a tiny fork of https://github.com/bocajim/dtls that works around an issue in the DTLS handshake when connecting to an IKEA Trådfri Gateway.

The rest of this README is identical to the original at the time of the forking.

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.

Key Features

  • 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
  • Supports DTLS session resumption
  • Designed for OMA LWM2M comliance LWM2M

TODO

  • 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
  • Add interface for custom DTLS session cache storage

Samples

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()

Documentation

http://godoc.org/github.com/bocajim/dtls

License

MIT

You can’t perform that action at this time.