OpenSSL session reuse does not work with TLS_client_method()

Jaya Muthiah jeevhi at
Wed Sep 15 11:56:51 UTC 2021

I am trying to reuse SSL_SESSION as below, it works fine when I use
TLSv1_2_client_method() to create context. However, it does not work when I
use TLS_client_method().

    if (!SSL_set_session(ssl, ssl_session)) {
            //code never reaches here so SSL_set_session is successful

    if (SSL_connect(ssl) != 1) {
     return -1;

    int reused = SSL_session_reused(ssl); <-- always returns zero for

    ssl_session = SSL_get1_session(ssl); // for future connections

Above code works fine with TLSv1_2_client_method() and SSL_session_reused()
returns 1, handshake time is also reduced considerably. However, if I use
TLS_client_method(), reuse does not work and SSL_session_reused() returns

Any idea what is wrong? OpenSSL version is 1.1.1.g
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the openssl-users mailing list