Skip to content

Commit cc1ca45

Browse files
committed
net: downloader: Don't expect DTLS even if sec_tag provided
Configure protocol type to DTLS/1.2 only if URI is coaps:// and then require sec_tag to be set. If sec_tag is provided, but URI is coap:// just use normal UDP/DGRAM. Signed-off-by: Seppo Takalo <[email protected]>
1 parent 2c64721 commit cc1ca45

File tree

1 file changed

+1
-2
lines changed
  • subsys/net/lib/downloader/src/transports

1 file changed

+1
-2
lines changed

subsys/net/lib/downloader/src/transports/coap.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,7 @@ static int dl_coap_init(struct downloader *dl, struct downloader_host_cfg *dl_ho
391391
coap->sock.proto = IPPROTO_UDP;
392392
coap->sock.type = SOCK_DGRAM;
393393

394-
if (strncmp(url, COAPS, (sizeof(COAPS) - 1)) == 0 ||
395-
(dl_host_cfg->sec_tag_count != 0 && dl_host_cfg->sec_tag_list != NULL)) {
394+
if (strncmp(url, COAPS, (sizeof(COAPS) - 1)) == 0) {
396395
coap->sock.proto = IPPROTO_DTLS_1_2;
397396
coap->sock.type = SOCK_DGRAM;
398397

0 commit comments

Comments
 (0)