DTLS-CoAP server from Contiki-NG fails during DTLS handshake

252 views Asked by At

I have flashed a cc2650 Sensortag with cc26xx-web-demo example in Contiki-NG with option MAKE_WITH_DTLS=1 now I want to access it through a coaps:// request. When I try to access it as coaps:// from cf-browser it shows handshake failed but it works fine with simple coap:// request. The demo server (californium.eclipseprojects.io) provided in cf-browser works on both coap and coaps. I have also tried accessing it with libcoap client but no luck.

Any idea what could be wrong with my implementation? There are any proper guides tutorials for DTLS-CoAP sever implementation in Contiki-NG?

1

There are 1 answers

9
chrysn On

DTLS as used in CoAP (and especially with the key stores available in contiki (which default to LwM2M) needs preshared keys between the client and the server; attempts to connect will fail without matching keys.

Unless you plan to use this with LwM2M (which the question gave no indication to), you can pick the simple key store by defining MAKE_COAP_DTLS_KEYSTORE_SIMPLE, and setting user and key because you may not want to use the default ones.

Then, you can pass --identity and --secret to cf-browser.