You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm using ftplibpp with OpenSSL and I'm trying to connect to a Filezilla Server with FTP over TLS (FTPS).
I just found that ftplibpp can't transfer data (even if already securely connected) to a FileZilla Server that Requires TLS session resumption, since I get this error:
"450 TLS session of data connection has not resumed or the session does not match the control connection"
If I untick "Require TLS session resumption on data connection when using PROT P" in FileZilla Server settings, then I'm able to do the transfers.
So, is there a way to add "TLS session resumption" ability to the ftplibpp ??
The text was updated successfully, but these errors were encountered:
So with a bit of guessing It seems I managed to have TLS resumption supported in ftpLibpp by simply modifying two functions (changes in bold):
int ftplib::FtpClose(ftphandle *nData)
{
[...]
#ifndef NOSSL SSL_shutdown(nData->ssl); //<---- close data connection, this is mandatory, if you dont call this only the first connect will work
SSL_free(nData->ssl);
#endif
free(nData);
if (ctrl) return readresp('2', ctrl);
return 1;
}
int ftplib::FtpAccess(const char *path, accesstype type, transfermode mode, ftphandle *nControl, ftphandle **nData)
{
[...]
#ifndef NOSSL
if (nControl->tlsdata)
{
(*nData)->ssl = SSL_new(nControl->ctx);
(*nData)->sbio = BIO_new_socket((*nData)->handle, BIO_NOCLOSE);
SSL_set_bio((*nData)->ssl,(*nData)->sbio,(*nData)->sbio);
*SSL_set_session( (nData)->ssl, SSL_get1_session(nControl->ssl) ); //<----------- Set same session ID of the control data (to support TLS session Resumption)
int ret = SSL_connect((*nData)->ssl);
if (ret != 1) return 0;
(*nData)->tlsdata = 1;
}
#endif
return 1;
}
Hello,
I'm using ftplibpp with OpenSSL and I'm trying to connect to a Filezilla Server with FTP over TLS (FTPS).
I just found that ftplibpp can't transfer data (even if already securely connected) to a FileZilla Server that Requires TLS session resumption, since I get this error:
"450 TLS session of data connection has not resumed or the session does not match the control connection"
If I untick "Require TLS session resumption on data connection when using PROT P" in FileZilla Server settings, then I'm able to do the transfers.
So, is there a way to add "TLS session resumption" ability to the ftplibpp ??
The text was updated successfully, but these errors were encountered: