aiocoap icon indicating copy to clipboard operation
aiocoap copied to clipboard

Alternative DTLS library

Open MPM1107 opened this issue 4 years ago • 4 comments

After a lot of digging around I have discovered that getting a dtls coap client working on windows is pretty much impossible with the current libraries available. After some more searching I have discovered this library which seemingly works very well cross-platform, as it only depends on OpenSSL and even includes prebuilt binaries for windows.

My question would be how difficult this would be to integrate into aiocoap as an alternative transport to tinydtls and if you would even consider it a valuable addition. I'm not that familiar with the aiocoap codebase yet so I don't even know how to go about adding it myself.

MPM1107 avatar Mar 18 '21 02:03 MPM1107

[Nov 2020] As of version 1.3.0, PyDTLS supports DTLS version 1.2

Finally! That's what was missing all these years. (CoAP requires 1.2).

My question would be how difficult this would be to integrate into aiocoap as an alternative transport to tinydtls and if you would even consider it a valuable addition

Should be really straightforward as it "just" needs a module in transports parallel to tie existing one in transports/tinydtls (about 400 LoC) and small glue parts wherever "tinydtls" is mentioned.

I can't tell whether I'd get around to doing anything with it, so if you'd get it started, that'd be greatly appreciated. (It's probably easiest to go for PSK in the first step and only later look into certificate based authentication; for the latter I expect some changes to the way credentials are stored).

chrysn avatar Mar 18 '21 07:03 chrysn

A little update:

It seems like I've hit the same issue you have had in the past. While PyDTLS now supports DTLS 1.2, there's still no support for PSK, which I need since the end goal is interfacing with Ikea's Tradfri gateway. Looks like I'll be looking into adding PSK support to PyDTLS first before attempting integration into aiocoap.

MPM1107 avatar Mar 18 '21 11:03 MPM1107

Is there an issue about this in the upstream tracker you could link here? (I'm having a little trouble finding the upstream tracker in the first place; https://pypi.org/project/python3-dtls/ says it was last updated in November but points to https://github.com/mcfreis/pydtls as a homepage which was last updated in 2017, has no issue tracker, and was forked from https://github.com/rbit/pydtls that was last updated even earlier).

chrysn avatar Mar 18 '21 11:03 chrysn

What about https://github.com/Synss/python-mbedtls? It has working PSK support.

derhex3r avatar Jun 26 '23 18:06 derhex3r