Skip to content

Implement DTSL (encrypted UDP sockets) #5270

Description

@beyonlo

Hello.

Are there any example about to use DTLS? I would like to use UDP protocol to communicate, but in the secure mode, like as a TCP socket using TLS. I found on docs just about ussl for TCP sockets.

Thank you.

Activity

  1. MrSurly commented on Oct 28, 2019

    @MrSurly
    Contributor

    I don't believe it's implemented. A while back, I took a look at doing so, and despite what I said in that thread, I did indeed abandon it.

    IIRC, the underlying stack (mbedtls) supports this.

  2. beyonlo commented on Oct 29, 2019

    @beyonlo
    Author

    @dpgeorge Any plans to implement DTLS?

    Thank you.

  3. dpgeorge commented on Oct 30, 2019

    @dpgeorge
    Member

    Any plans to implement DTLS?

    Not in the short term, but in the medium term (~3 months) it could be done if there's enough interest.

  4. dpgeorge commented on Oct 30, 2019

    @dpgeorge
    Member

    For reference, using DTLS on CPython is possible via https://github.com/rbit/pydtls

  5. changed the title [-]DTSL example - missing on the docs.[/-] [+]Implement DTSL (encrypted UDP sockets)[/+] on Oct 30, 2019
  6. dmartauz commented on Oct 30, 2019

    @dmartauz

    I am also interested in DTLS support, however I would prefer it to be done similarly to ucryptolib.aes with encrypt/decrypt methods. The reason is that the output would be used as UDP payload for NB-IoT modem controlled via AT commands which is not bound to lwip.

  7. dpgeorge commented on Oct 31, 2019

    @dpgeorge
    Member

    The reason is that the output would be used as UDP payload for NB-IoT modem controlled via AT commands which is not bound to lwip.

    Note that the ssl module can currently be used stand-alone, ie without lwip/sockets. It just requires a suitable stream (eg user class derived from io.IOBase) to be passed in to ssl.wrap_socket I would envisage a similar thing for DTLS.

  8. Sebbb commented on Mar 12, 2021

    @Sebbb

    Any plans to implement DTLS?

    Not in the short term, but in the medium term (~3 months) it could be done if there's enough interest.

    I'm interested as well, I'm searching for an option to encrypt/decrypt UDP packets on an ESP32.

    The possibility to communicate securely definitely makes sense, also in the IoT/embedded world :)

  9. added a commit that references this issue on Aug 31, 2021
  10. dpgeorge commented on Feb 14, 2025

    @dpgeorge
    Member

    DTLS is now supported, see commit 321b30c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature requests, new feature implementations

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions