[riot-notifications] [RIOT-OS/RIOT] net/gcoap: support DTLS (#15549)

benpicco notifications at github.com
Wed May 26 15:25:59 CEST 2021


@benpicco commented on this pull request.



> +static void _tl_get_socket(coap_socket_t *sock)
+{
+#if IS_ACTIVE(CONFIG_GCOAP_ENABLE_DTLS)
+    sock->type = COAP_SOCKET_TYPE_DTLS;
+    sock->socket.dtls = &_sock_dtls;
+#else
+    sock->type = COAP_SOCKET_TYPE_UDP;
+    sock->socket.udp = &_sock_udp;
+#endif
+}
+
+static ssize_t _tl_send(coap_socket_t *sock, const void *data, size_t len,
+                      const sock_udp_ep_t *remote)
+{
+    int res;
+#if IS_ACTIVE(CONFIG_GCOAP_ENABLE_DTLS)

Hm what would be needed to also being able to receive non-encrypted answers?
We could do that as a follow-up, but generally it should still be possible to do unencrypted requests when connecting to a non-COAPS server 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15549#discussion_r639723126
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210526/212c5c2c/attachment.htm>


More information about the notifications mailing list