Svemu - Reparto Sviluppo wrote:
> Hi,
> i use a TSslFtpClient and TSslContext for upload and download data
> from FtpServer over TLS.
> 
> some customers have this error:
> 500 Control connection closed - Connection aborted (#10053)

Strange, was it possible to post a common FTP log as well?
With method ReceiveAsync the component doesn't try to
establish a secure data channel/connection. However some server 
may require it, just a guess (haven't read your attached log yet).
If so, do not use method ReceiveAsync but the low level methods instead. 

Example FTP log, method ReceiveAsync, data channel plain text allowed:
Executing Requested Command
< 220 FileZilla Server version 0.9.24 beta
Session Connected, error = 0
> AUTH SSL
< 234 Using authentication type SSL
! SSL handshake OK
> USER ics
< 331 Password required for ics
> PASS ics
< 230 Logged on
> CWD /
< 250 CWD successful. "/" is current directory.
> TYPE I
< 200 Type set to I
> PASV
< 227 Entering Passive Mode (192,168,178,200,8,240)
> RETR _tmp.txt
< 150 Connection accepted
< 226 Transfer OK
! 1,07Kbytes received/sent in 0 milliseconds
> QUIT
< 221 Goodbye

Example FTP log, method ReceiveAsync, server requires secure data channel:
Executing Requested Command
< 220 FileZilla Server version 0.9.24 beta
Session Connected, error = 0
> AUTH SSL
< 234 Using authentication type SSL
! SSL handshake OK
> USER ics
< 331 Password required for ics
> PASS ics
< 230 Logged on
> CWD /
< 250 CWD successful. "/" is current directory.
> TYPE I
< 200 Type set to I
> PASV
< 227 Entering Passive Mode (192,168,178,200,8,246)
> RETR _tmp.txt
< 550 PROT P required
Request 6 Done.
StatusCode = 550
LastResponse was : '550 PROT P required'
Error = 550 (550 PROT P required)

--
Arno Garrels


> 
> this is the section of code that i use for download:
> 
>         FtpClient1.DisplayFileFlag := false;
>         FtpClient1.Passive         := true;
>         FtpClient1.Binary          := true;
> 
>         if UseTLS then
>         begin
>             FtpClient1.SSLContext      := CM.FtpCliSslContext;
>             FtpClient1.ProtLevel       := 'P';
>             FtpClient1.PBSZSize        := 0;
>             FtpClient1.SslType         := sslTypeAuthTls;
>         end;
> 
>         FtpClient1.ReceiveAsync;
> 
> 
> 
> anyone have a suggestion?
> 
> thank you in advantage.
> 
> 
> 
> this is the last part of ics log:
> 
> 18.09.16.125 >|227 Entering Passive Mode (82,0,0,0,78,76)|
> 
> 18.09.16.125 ! HighLevelAsync 0
> 18.09.16.125 ! Data Socket Connect
> 18.09.16.125 TWSocket will connect to 82.0.0.0:20044
> 18.09.16.125 033FABF0 PutDataInSslBuffer 748 len 6  [254]
> 18.09.16.125 033FABF0 SslTryToSend 748
> 18.09.16.125 033FABF0 BIO_write(sslbio, 0x33D8110, 6) = 6   [255]
> 18.09.16.125 033FABF0 BIO_ctrl(sslbio, BIO_CTRL_FLUSH, 0, 0x0) = 1  
> [256] 
> 18.09.16.125 033FABF0 TriggerEvents 748 SslState: SSL_ST_OK  //
> MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1
> bSslAllSent=-1 bAllSent=0 
> 18.09.16.125 033FABF0 BIO_ctrl_pending(nbio) = 37   [257]
> 18.09.16.125 033FABF0 TriggerEvent sslFdWrite 748
> 18.09.16.125 033FABF0 BIO_ctrl_pending(sslbio) = 0   [258]
> 18.09.16.125 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [259] 
> 18.09.16.125 033FABF0 TriggerEvents 748 SslState: SSL_ST_OK  //
> MayFD_Read=0 MayDoRecv=-1 MayFD_Write=0 MaySslTryToSend=-1
> bSslAllSent=-1 bAllSent=0 
> 18.09.16.125 033FABF0 BIO_ctrl_pending(nbio) = 37   [260]
> 18.09.16.125 033FABF0 BIO_ctrl_pending(sslbio) = 0   [261]
> 18.09.16.125 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [262] 
> 18.09.16.125 SslAsyncSelect 748, 2 FD_WRITE
> 18.09.16.125 033FABF0 TCustomSslWSocket.Do_FD_WRITE 748
> 18.09.16.125 033FABF0 BIO_ctrl_pending(nbio) = 37   [263]
> 18.09.16.125 033FABF0 BIO_read(nbio, 0x13AED8, 37) = 37   [264]
> 18.09.16.125 033FABF0 my_RealSend (0x2EC, 1289944, 37) = 37   [265]
> 18.09.16.125 033FABF0 BIO_ctrl_pending(nbio) = 0   [266]
> 18.09.16.125 033FABF0 BIO_ctrl_pending(nbio) = 0   [267]
> 18.09.16.125 033FABF0 TriggerDataSent 748
> 18.09.16.125 033FABF0 TriggerEvents 748 SslState: SSL_ST_OK  //
> MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1
> bSslAllSent=-1 bAllSent=-1 
> 18.09.16.125 033FABF0 BIO_ctrl_pending(nbio) = 0   [268]
> 18.09.16.125 033FABF0 BIO_ctrl_pending(sslbio) = 0   [269]
> 18.09.16.125 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [270] 
> 18.09.16.171 ! Data Session Connected (Get)
> 18.09.16.171 033FB3B0 TryToSend 808
> 18.09.16.171 033FB3B0 TriggerDataSent 808
> 18.09.16.203 033FABF0 TCustomSslWSocket.Do_FD_READ 748
> 18.09.16.203 033FABF0 BIO_ctrl_pending(sslbio) = 0   [271]
> 18.09.16.203 033FABF0 BIO_ctrl_get_read_request(nbio) = 0   [272]
> 18.09.16.203 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [273] 
> 18.09.16.203 033FABF0 Winsock recv( 748, 0x13CED4, 4096, 0) = 69  
> [274] 
> 18.09.16.203 033FABF0 BIO_write(nbio, 0x13CED4, 69) = 69   [275]
> 18.09.16.203 033FABF0 BIO_ctrl(nbio, BIO_CTRL_FLUSH, 0, 0x0) = 1  
> [276] 
> 18.09.16.203 033FABF0 BIO_read(sslbio, 0x1, 0) = 0   [277]
> 18.09.16.203 033FABF0 BIO_ctrl_pending(sslbio) = 30   [278]
> 18.09.16.203 033FABF0 TriggerDataAvailable (Do_FD_READ_2) 748
> 18.09.16.203 033FABF0 TCustomSslWSocket.DoRecv 748
> 18.09.16.203 033FABF0 BIO_ctrl_pending(sslbio) = 30   [279]
> 18.09.16.203 033FABF0 BIO_read(sslbio, 0x33EC216, 4095) = 30   [280]
> 18.09.16.203 033FABF0 TriggerEvents 748 SslState: SSL_ST_OK  //
> MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1
> bSslAllSent=-1 bAllSent=-1 
> 18.09.16.203 033FABF0 BIO_ctrl_pending(nbio) = 0   [281]
> 18.09.16.203 033FABF0 BIO_ctrl_pending(sslbio) = 0   [282]
> 18.09.16.203 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [283] 
> 18.09.16.203 >|150 Accepted data connection|
> 
> 18.09.16.203 033FABF0 TriggerEvents 748 SslState: SSL_ST_OK  //
> MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1
> bSslAllSent=-1 bAllSent=-1 
> 18.09.16.203 033FABF0 BIO_ctrl_pending(nbio) = 0   [284]
> 18.09.16.203 033FABF0 BIO_ctrl_pending(sslbio) = 0   [285]
> 18.09.16.203 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [286] 
> 18.09.16.218 033FABF0 TCustomSslWSocket.Do_FD_READ 748
> 18.09.16.218 033FABF0 BIO_ctrl_pending(sslbio) = 0   [287]
> 18.09.16.218 033FABF0 BIO_ctrl_get_read_request(nbio) = 0   [288]
> 18.09.16.218 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [289] 
> 18.09.16.218 033FABF0 Winsock recv( 748, 0x137F0C, 4096, 0) = 106  
> [290] 
> 18.09.16.218 033FABF0 BIO_write(nbio, 0x137F0C, 106) = 106   [291]
> 18.09.16.218 033FABF0 BIO_ctrl(nbio, BIO_CTRL_FLUSH, 0, 0x0) = 1  
> [292] 
> 18.09.16.218 033FABF0 BIO_read(sslbio, 0x1, 0) = 0   [293]
> 18.09.16.218 033FABF0 BIO_ctrl_pending(sslbio) = 18   [294]
> 18.09.16.218 033FABF0 TriggerDataAvailable (Do_FD_READ_2) 748
> 18.09.16.218 033FABF0 TCustomSslWSocket.DoRecv 748
> 18.09.16.218 033FABF0 BIO_ctrl_pending(sslbio) = 18   [295]
> 18.09.16.218 033FABF0 BIO_read(sslbio, 0x33EC216, 4095) = 18   [296]
> 18.09.16.218 033FABF0 TriggerEvents 748 SslState: SSL_ST_OK  //
> MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1
> bSslAllSent=-1 bAllSent=-1 
> 18.09.16.218 033FABF0 BIO_ctrl_pending(nbio) = 0   [297]
> 18.09.16.218 033FABF0 BIO_ctrl_pending(sslbio) = 53   [298]
> 18.09.16.218 033FABF0 TriggerEvent sslFdRead 748
> 18.09.16.218 >|226-Options: -a |
> 
> 18.09.16.218 033FABF0 TriggerEvents 748 SslState: SSL_ST_OK  //
> MayFD_Read=0 MayDoRecv=0 MayFD_Write=-1 MaySslTryToSend=-1
> bSslAllSent=-1 bAllSent=-1 
> 18.09.16.218 033FABF0 BIO_ctrl_pending(nbio) = 0   [299]
> 18.09.16.218 033FABF0 BIO_ctrl_pending(sslbio) = 53   [300]
> 18.09.16.218 SslAsyncSelect 748, 1 FD_READ
> 18.09.16.218 033FABF0 TCustomSslWSocket.Do_FD_READ 748
> 18.09.16.218 033FABF0 BIO_ctrl_pending(sslbio) = 53   [301]
> 18.09.16.218 033FABF0 TriggerDataAvailable (Do_FD_READ_1) 748
> 18.09.16.218 033FABF0 TCustomSslWSocket.DoRecv 748
> 18.09.16.218 033FABF0 BIO_ctrl_pending(sslbio) = 53   [302]
> 18.09.16.218 033FABF0 BIO_read(sslbio, 0x33EC216, 4095) = 23   [303]
> 18.09.16.218 033FABF0 TriggerEvents 748 SslState: SSL_ST_OK  //
> MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1
> bSslAllSent=-1 bAllSent=-1 
> 18.09.16.218 033FABF0 BIO_ctrl_pending(nbio) = 0   [304]
> 18.09.16.218 033FABF0 BIO_ctrl_pending(sslbio) = 0   [305]
> 18.09.16.218 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [306] 
> 18.09.16.218 >|226 246 matches total|
> 
> 18.09.16.218 ! Next3GetAsync
> 18.09.16.218 033FABF0 TCustomSslWSocket.Do_FD_WRITE 748
> 18.09.16.218 033FABF0 BIO_ctrl_pending(nbio) = 0   [307]
> 18.09.16.218 033FABF0 BIO_read(nbio, 0x135F10, 0) = 0   [308]
> 18.09.16.218 033FABF0 BIO_ctrl_pending(nbio) = 0   [309]
> 18.09.16.218 033FABF0 TriggerEvents 748 SslState: SSL_ST_OK  //
> MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1
> bSslAllSent=-1 bAllSent=-1 
> 18.09.16.218 033FABF0 BIO_ctrl_pending(nbio) = 0   [310]
> 18.09.16.218 033FABF0 BIO_ctrl_pending(sslbio) = 0   [311]
> 18.09.16.218 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [312] 
> 18.09.16.218 033FABF0 TCustomSslWSocket.Do_FD_WRITE 748
> 18.09.16.218 033FABF0 BIO_ctrl_pending(nbio) = 0   [313]
> 18.09.16.218 033FABF0 BIO_read(nbio, 0x135F10, 0) = 0   [314]
> 18.09.16.218 033FABF0 BIO_ctrl_pending(nbio) = 0   [315]
> 18.09.16.218 033FABF0 TriggerEvents 748 SslState: SSL_ST_OK  //
> MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1
> bSslAllSent=-1 bAllSent=-1 
> 18.09.16.218 033FABF0 BIO_ctrl_pending(nbio) = 0   [316]
> 18.09.16.218 033FABF0 BIO_ctrl_pending(sslbio) = 0   [317]
> 18.09.16.218 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [318] 
> 18.09.16.218 ! Data Session closed
> 18.09.16.218 ! Next3GetAsync
> 18.09.16.218 ! HighLevelAsync 0
> 18.09.16.218 033FABF0 PutDataInSslBuffer 748 len 6  [319]
> 18.09.16.218 033FABF0 SslTryToSend 748
> 18.09.16.218 033FABF0 BIO_write(sslbio, 0x33D8110, 6) = 6   [320]
> 18.09.16.218 033FABF0 BIO_ctrl(sslbio, BIO_CTRL_FLUSH, 0, 0x0) = 1  
> [321] 
> 18.09.16.218 033FABF0 TriggerEvents 748 SslState: SSL_ST_OK  //
> MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1
> bSslAllSent=-1 bAllSent=0 
> 18.09.16.218 033FABF0 BIO_ctrl_pending(nbio) = 37   [322]
> 18.09.16.218 033FABF0 TriggerEvent sslFdWrite 748
> 18.09.16.218 033FABF0 BIO_ctrl_pending(sslbio) = 0   [323]
> 18.09.16.218 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [324] 
> 18.09.16.218 033FB3B0 *CloseCalled 808
> 18.09.16.218 033FB3B0 TCustomWSocket.Shutdown 1 808
> 18.09.16.218 SslAsyncSelect 748, 2 FD_WRITE
> 18.09.16.218 033FABF0 TCustomSslWSocket.Do_FD_WRITE 748
> 18.09.16.218 033FABF0 BIO_ctrl_pending(nbio) = 37   [325]
> 18.09.16.218 033FABF0 BIO_read(nbio, 0x1376E0, 37) = 37   [326]
> 18.09.16.218 033FABF0 my_RealSend (0x2EC, 1275616, 37) = 37   [327]
> 18.09.16.218 033FABF0 BIO_ctrl_pending(nbio) = 0   [328]
> 18.09.16.218 033FABF0 BIO_ctrl_pending(nbio) = 0   [329]
> 18.09.16.218 033FABF0 TriggerDataSent 748
> 18.09.16.218 033FABF0 TriggerEvents 748 SslState: SSL_ST_OK  //
> MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1
> bSslAllSent=-1 bAllSent=-1 
> 18.09.16.218 033FABF0 BIO_ctrl_pending(nbio) = 0   [330]
> 18.09.16.218 033FABF0 BIO_ctrl_pending(sslbio) = 0   [331]
> 18.09.16.218 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [332] 
> 18.09.16.265 033FABF0 TCustomSslWSocket.Do_FD_READ 748
> 18.09.16.265 033FABF0 BIO_ctrl_pending(sslbio) = 0   [333]
> 18.09.16.265 033FABF0 BIO_ctrl_get_read_request(nbio) = 0   [334]
> 18.09.16.265 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [335] 
> 18.09.16.265 033FABF0 Winsock recv( 748, 0x13CED4, 4096, 0) = -1  
> [336] 
> 18.09.16.265 033FABF0 BIO_ctrl_pending(sslbio) = 0   [337]
> 18.09.16.265 033FABF0 TriggerEvents 748 SslState: SSL_ST_OK  //
> MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1
> bSslAllSent=-1 bAllSent=-1 
> 18.09.16.265 033FABF0 BIO_ctrl_pending(nbio) = 0   [338]
> 18.09.16.265 033FABF0 BIO_ctrl_pending(sslbio) = 0   [339]
> 18.09.16.265 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [340] 
> 18.09.16.265 033FABF0 TCustomSslWSocket.Do_FD_CLOSE error #10053 748
> 18.09.16.265 033FABF0 *CloseCalled 748
> 18.09.16.265 033FABF0 BIO_ctrl_pending(sslbio) = 0   [341]
> 18.09.16.265 033FABF0 Socket data pending: 0 Err: 0 748
> 18.09.16.265 033FABF0 SslInternalShutdown 748
> 18.09.16.265 ICB> SSL3 alert write warning close notify
> 18.09.16.265 033FABF0 BIO_ctrl_pending(nbio) = 37   [342]
> 18.09.16.265 033FABF0 SslShutdownCompleted *0* 748
> 18.09.16.265 033FABF0 TriggerEvents 748 SslState: SSL_ST_OK  //
> MayFD_Read=0 MayDoRecv=-1 MayFD_Write=-1 MaySslTryToSend=-1
> bSslAllSent=-1 bAllSent=-1 
> 18.09.16.265 033FABF0 BIO_ctrl_pending(nbio) = 37   [343]
> 18.09.16.265 033FABF0 TriggerEvent sslFdWrite 748
> 18.09.16.265 033FABF0 BIO_ctrl_pending(sslbio) = 0   [344]
> 18.09.16.265 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [345] 
> 18.09.16.265 SslAsyncSelect 748, 2 FD_WRITE
> 18.09.16.265 033FABF0 TCustomSslWSocket.Do_FD_WRITE 748
> 18.09.16.265 033FABF0 BIO_ctrl_pending(nbio) = 37   [346]
> 18.09.16.265 033FABF0 BIO_read(nbio, 0x13AED8, 37) = 37   [347]
> 18.09.16.265 033FABF0 my_RealSend (0x2EC, 1289944, 37) = -1   [348]
> 18.09.16.265 033FABF0 SslShutdownCompleted *0* 748
> 18.09.16.265 033FABF0 TriggerEvents 748 SslState: SSL_ST_OK  //
> MayFD_Read=0 MayDoRecv=-1 MayFD_Write=0 MaySslTryToSend=-1
> bSslAllSent=-1 bAllSent=0 
> 18.09.16.265 033FABF0 BIO_ctrl_pending(nbio) = 0   [349]
> 18.09.16.265 033FABF0 BIO_ctrl_get_write_guarantee(sslbio) = 4096  
> [350] 
> 18.09.16.265 033FABF0 BIO_ctrl_pending(sslbio) = 0   [351]
> 18.09.16.265 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [352] 
> 18.09.26.421 033FABF0 PutDataInSslBuffer 748 len 6  [353]
> 18.09.26.421 033FABF0 SslTryToSend 748
> 18.09.26.421 033FABF0 TriggerEvent sslFdClose 748
> 18.09.26.546 SslAsyncSelect 748, 32 FD_CLOSE
> 18.09.26.546 033FABF0 TCustomSslWSocket.Do_FD_CLOSE error #0 748
> 18.09.26.546 033FABF0 BIO_ctrl_pending(sslbio) = 0   [354]
> 18.09.26.546 033FABF0 Socket data pending: 0 Err: 0 748
> 18.09.26.546 033FABF0 SslInternalShutdown 748
> 18.09.26.546 033FABF0 SslShutdownCompleted *0* 748
> 18.09.26.546 033FABF0 TriggerEvents 748 SslState: SSL_ST_OK  //
> MayFD_Read=0 MayDoRecv=-1 MayFD_Write=0 MaySslTryToSend=-1
> bSslAllSent=0 bAllSent=0 
> 18.09.26.546 033FABF0 BIO_ctrl_pending(nbio) = 0   [355]
> 18.09.26.546 033FABF0 BIO_ctrl_get_write_guarantee(sslbio) = 4096  
> [356] 
> 18.09.26.562 033FABF0 SslTryToSend 748
> 18.09.26.562 033FABF0 TriggerEvent sslFdClose 748
> 18.09.26.562 033FABF0 BIO_ctrl_pending(sslbio) = 0   [357]
> 18.09.26.562 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [358] 
> 18.09.26.562 SslAsyncSelect 748, 32 FD_CLOSE
> 18.09.26.562 033FABF0 TCustomSslWSocket.Do_FD_CLOSE error #0 748
> 18.09.26.562 033FABF0 BIO_ctrl_pending(sslbio) = 0   [359]
> 18.09.26.562 033FABF0 Socket data pending: 0 Err: 0 748
> 18.09.26.562 033FABF0 SslInternalShutdown 748
> 18.09.26.562 033FABF0 SslShutdownCompleted *0* 748
> 18.09.26.562 033FABF0 TriggerEvents 748 SslState: SSL_ST_OK  //
> MayFD_Read=0 MayDoRecv=-1 MayFD_Write=0 MaySslTryToSend=0
> bSslAllSent=0 bAllSent=0 
> 18.09.26.562 033FABF0 BIO_ctrl_pending(nbio) = 0   [360]
> 18.09.26.562 033FABF0 BIO_ctrl_get_write_guarantee(sslbio) = 4096  
> [361] 
> 18.09.26.562 033FABF0 BIO_ctrl_pending(sslbio) = 0   [362]
> 18.09.26.562 033FABF0 BIO_ctrl_get_write_guarantee(nbio) = 4096  
> [363] 
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to