nRF9160 - mfw 1.3.5 - NRF_SO_SEC_DTLS_CID results in "errno 109 (Protocol not available) "

nRF9160 SICA B1A, mfw 1.3.5, NCS 2.4.0

Using the v2.4.0, lesson 5, exercise 2, solution and adding the setup for DTLS CID with

    sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_DTLS_1_2);
    if (sock < 0) {
        LOG_ERR("Failed to create CoAP socket: %d.\n", errno);
        return -errno;
    }

    int cid = NRF_SO_SEC_DTLS_CID_SUPPORTED;
    err = setsockopt(sock, NRF_SOL_SECURE, NRF_SO_SEC_DTLS_CID, &cid, sizeof(cid));
    if (err) {
        LOG_ERR("Failed to setup socket security DTLS CID supported, errno %d (%s)\n", errno, strerror(errno));
        cid = NRF_SO_SEC_DTLS_CID_ENABLED;
        err = setsockopt(sock, NRF_SOL_SECURE, NRF_SO_SEC_DTLS_CID, &cid, sizeof(cid));
        if (err) {
            LOG_ERR("Failed to setup socket security DTLS CID enabled, errno %d (%s)\n", errno, strerror(errno));
            return -errno;
        }
    }

    /* STEP 7.1 - Set peer verification to be required */
    enum {
        NONE = 0,
        OPTIONAL = 1,
        REQUIRED = 2,
    };

    int verify = REQUIRED;

    err = setsockopt(sock, SOL_TLS, TLS_PEER_VERIFY, &verify, sizeof(verify));
    if (err) {
        LOG_ERR("Failed to setup peer verification, errno %d\n", errno);
        return -errno;
    }


I get an error: "errno 109 (Protocol not available)"

Are there any samples to show, how that works?

trace-2023-07-18T10-37-17.929Z.zip

Related