coap-rs icon indicating copy to clipboard operation
coap-rs copied to clipboard

Support DTLS encryption

Open tiziano88 opened this issue 7 years ago • 10 comments

Some products (e.g. IKEA Tradfri) use COAP over DTLS (TLS over UDP). It would be great to have the library support this use case.

See

  • https://learn.pimoroni.com/tutorial/sandyj/controlling-ikea-tradfri-lights-from-your-pi
  • https://tools.ietf.org/html/rfc6347
  • https://docs.rs/openssl/0.9.19/openssl/ssl/struct.SslMethod.html#method.dtls

tiziano88 avatar Sep 23 '17 00:09 tiziano88

Thank you for your advice. I have the similar idea before. Unfortunately, I haven't enough time to implement this feature. Of cource , any PR about the feature are welcome.

Covertness avatar Sep 23 '17 08:09 Covertness

DTLS written in Rust seems not available. I found two issues about this: https://github.com/ctz/rustls/issues/40 https://github.com/sfackler/rust-openssl/issues/528 Waiting for the implement.

Covertness avatar Mar 21 '18 14:03 Covertness

I thought Core CoAP Standard included DTLS 1.2 .

StEvUgnIn avatar Oct 13 '20 10:10 StEvUgnIn

I found this code based on tokio-openssl which includes DTLS encryption: https://github.com/simmons/tokio-dtls-example/blob/master/src/main.rs

Edit: There are multiple implementations of rust-openssl for using sslMethod::dtls() I suggest that we take inspiration from this clean example https://github.com/JRF63/DTLS-Example/blob/master/src/main.rs

StEvUgnIn avatar Oct 13 '20 11:10 StEvUgnIn

I started working on the implementation based on the latter example. I would like @Covertness to assign this issue to me before I present my PR.

StEvUgnIn avatar Oct 14 '20 12:10 StEvUgnIn

I am working on now after a family member of mine had health issue. Have you tried this project? https://github.com/google/rust-async-coap

StEvUgnIn avatar Oct 28 '20 14:10 StEvUgnIn

sorry for hear that. I noticed it before. It seems only implement some basic functions and haven't contribute for a long time

Covertness avatar Oct 29 '20 15:10 Covertness

Hi guys! Has anybody been able to make progress on this? I looked at this a couple of years ago implementing DTLS with rust-async-coap (see async-coap-dtls) but my very crude attempt is quite clunky. DTLS 1.3 should make things a lot simpler but this is still a draft if I'm not mistaken...

fdeantoni avatar Jul 27 '21 01:07 fdeantoni

I think it's not easy to implement. I would appreciate if you could finish it.

Covertness avatar Jul 27 '21 14:07 Covertness

@fdeantoni Feel free to continue if you are interested.

StEvUgnIn avatar Jul 28 '21 20:07 StEvUgnIn

https://github.com/Covertness/coap-rs/pull/88

Covertness avatar Jan 16 '24 13:01 Covertness