TLS/SSL session resume on FTP transfer connection with OpenSSL

百般思念 提交于 2019-11-30 22:32:44

You must specifically enable client session caching on your SSL_CTX object with:

SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_CLIENT);

You may also need to increase the default session cache timeout (the default is 300 seconds), using SSL_CTX_set_timeout().

(You must also be creating your SSL objects from the same SSL_CTX object).

Using the SSL_get1_session and the SSL_set_session worked in the end. I must have used them incorrectly when trying the first time.

  • Once the TLS/SSL session on the control connection is established, use SSL_get1_session to retrieve the session. I specifically do it from a callback set by the SSL_set_info_callback, when where & SSL_ST_CONNECT.
  • Call the SSL_set_session with the reference to the control connection session, when setting up TLS/SSL session for the data connection.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!