I am writing FTP client.

I am using InitializeSecurityContext for tls1.2 authentication with the FTP server.

I am trying to connect to FileZilla server.

Control connection handshake going good.

As for Data connection, the handshake fail and I am getting :
"450 TLS session of data connection has not resumed or the session does not match the control connection

My FTP client works well when the required session resumption option in FileZilla is off but i want it to work when it is ON as well.

So my question is what I need to change/add so it will support session resumption

I read that i need to send InitializeSecurityContext (in the data connection) the same host and the same phCredential of the control connection and that is exactly what i am doing but still get that error and handshake fail.