Skip to content
DTLS 1.0 client/server in go.
Branch: master
Clone or download
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 Fix for CCM cipher modifying the original ciphertext which prevented … Nov 9, 2018
.gitignore Initial commit of DTLS client/server. Nov 19, 2016
.travis.yml Minor travis update. Nov 20, 2016
LICENSE Initial commit of DTLS client/server. Nov 19, 2016
README.md Updated readme. Nov 9, 2018
alert.go Added shutdown handling, alerts, and improved logging. Nov 26, 2016
bytereader.go Major refactor into single directory. Nov 20, 2016
bytewriter.go Major refactor into single directory. Nov 20, 2016
common.go
crypto.go Fix to read nonce from incoming packets instead of computing it, as R… Oct 19, 2018
crypto_test.go Major refactor into single directory. Nov 20, 2016
debug.go Minor logging improvements. Nov 25, 2016
dtls.go Moved code to start new receiver to improve performance. Feb 25, 2019
dtls_test.go Support for resuming DTLS sessions. Nov 9, 2018
handshake.go
handshake_clienthello.go Support for resuming DTLS sessions. Nov 9, 2018
handshake_clientkeyexchange.go Major refactor into single directory. Nov 20, 2016
handshake_finished.go
handshake_header.go Major refactor into single directory. Nov 20, 2016
handshake_helloverifyrequest.go Major refactor into single directory. Nov 20, 2016
handshake_serverhello.go Major refactor into single directory. Nov 20, 2016
handshake_serverhellodone.go Major refactor into single directory. Nov 20, 2016
handshake_serverkeyexchange.go Major refactor into single directory. Nov 20, 2016
handshake_test.go Support for resuming DTLS sessions. Nov 9, 2018
handshake_unknown.go Major refactor into single directory. Nov 20, 2016
keystore.go Added error to PSK retrieval for quick abort. Feb 26, 2019
log.go Changed logging format to put peer as a separate value. Oct 27, 2017
peer.go Moved code to start new receiver to improve performance. Feb 25, 2019
record.go Fixed receiver to check for receiving appdata packets before the hand… Mar 30, 2017
record_test.go Added shutdown handling, alerts, and improved logging. Nov 26, 2016
session.go Added timer for duration of handshakes for analysis of delays during … Feb 25, 2019
session_cache.go Support for resuming DTLS sessions. Nov 9, 2018
session_handshake.go Added error to PSK retrieval for quick abort. Feb 26, 2019
session_test.go Merged alert into main namespace. Nov 20, 2016
transport.go
transport_udp.go Changed logging format to put peer as a separate value. Oct 27, 2017

README.md

dtls

Build Status Coverage GoDoc License ReportCard

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.

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.