<div dir="ltr">Hello openssl-dev team,<div><br></div><div>Having query regarding DTLS session resumption when configured SSL_CTX with DTLS_ANY_VERSION. </div><div><br></div><div>When we select SSL_CTX with DTLS_ANY_VERSION, method will be of DTLS_Server_method(), which will have ssl_ctx->version as 0xFEFD to support both the versions (i.e. DTLS1.0 and DTLS1.2).</div><div><br></div><div>During handshake, we landed on to version DTLS1.0.i.e. s->session->version holds 0xFEFF. </div><div><br></div><div>In order to perform session resumption, we derived new SSL structure from global ssl_ctx using SSL_new() and tried performing ssl handshake.</div><div><br></div><div>With the below logic, </div><div>else {</div><div>        i = ssl_get_prev_session(s, p, j, d + n);</div><div>        /*</div><div>         * Only resume if the session's version matches the negotiated</div><div>         * version.</div><div>         * RFC 5246 does not provide much useful advice on resumption</div><div>         * with a different protocol version. It doesn't forbid it but</div><div>         * the sanity of such behaviour would be questionable.</div><div>         * In practice, clients do not accept a version mismatch and</div><div>         * will abort the handshake with an error.</div><div>         */</div><div>        if (i == 1 && s->version == s->session->ssl_version) { /* previous</div><div>                                                                * session */</div><div>            s->hit = 1;</div><div>        } else if (i == -1)</div><div>            goto err;</div><div>        else {                  /* i == 0 */</div><div><br></div><div>            if (!ssl_get_new_session(s, 1))</div><div>                goto err;</div><div>        }</div><div><br></div><div>Since s->version is with 0xFEFD and s->session->ssl_version is 0xFEFF, we always try for new session and wont land on to session resumption though client has sent the  session_id. </div><div><br></div><div>Is this intended behaviour? Please clarify.</div><div><br></div><div>Thanks,</div><div>Rajeswari.</div><div><br></div><div><br></div></div>