TLS/SSL session resume on FTP transfer connection with OpenSSL

后端 未结 2 1687
春和景丽
春和景丽 2021-01-03 07:37

I\'m open source developer implementing FTP client (WinSCP).

I\'m trying to resume TLS/SSL session from the FTP control socket on the transfer socket. Some FTP serve

相关标签:
2条回答
  • 2021-01-03 08:22

    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).

    0 讨论(0)
  • 2021-01-03 08:24

    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.
    0 讨论(0)
提交回复
热议问题