gpt4 book ai didi

ruby - 如果运行了 tls_start,EventMachine 会在 close_connection 上发出 close_notify 吗?

转载 作者:数据小太阳 更新时间:2023-10-29 06:37:03 27 4
gpt4 key购买 nike

我正在尝试编写一个基于 EventMachine 的简单 FTPS 服务器。

控制 socket 工作正常。当使用数据套接字进行数据传输时,似乎一切正常(TLS 握手成功完成并接收到数据),但随后我收到一条错误消息。这是我在 Filezilla 中得到的:

Command:    LIST
Response: 150 Opening ASCII mode data connection for file list
Trace: CFtpControlSocket::TransferParseResponse()
Trace: code = 1
Trace: state = 4
Trace: CFtpControlSocket::SendNextCommand()
Trace: CFtpControlSocket::TransferSend()
Trace: state = 5
Trace: CTransferSocket::OnConnect
Trace: CTlsSocket::Handshake()
Trace: gnutls_session_get_data on primary socket failed: -51
Trace: CTlsSocket::ContinueHandshake()
Trace: CTlsSocket::OnSend()
Trace: CTlsSocket::OnSend()
Trace: CTlsSocket::OnRead()
Trace: CTlsSocket::ContinueHandshake()
Trace: CTlsSocket::OnRead()
Trace: CTlsSocket::ContinueHandshake()
Trace: Handshake successful
Trace: Cipher: AES-256-CBC, MAC: SHA1
Trace: CTlsSocket::OnRead()
Trace: CTransferSocket::OnConnect
Trace: CTransferSocket::OnReceive(), m_transferMode=0
Listing: -rwxrwxrwx 1 owner group 1011 Dec 12 23:05 a.tmp
Trace: CTlsSocket::Failure(-9, 0)
Error: GnuTLS error -9: A TLS packet with unexpected length was received.
Status: Server did not properly shut down TLS connection
Error: Could not read from transfer socket: ECONNABORTED - Connection aborted
Trace: CTransferSocket::TransferEnd(3)
Trace: CFtpControlSocket::OnReceive()
Response: 226 Closing data connection, sent 70 bytes
Trace: CFtpControlSocket::TransferParseResponse()
Trace: code = 2
Trace: state = 5
Trace: CFtpControlSocket::SendNextCommand()
Trace: CFtpControlSocket::TransferSend()
Trace: state = 8
Trace: CFtpControlSocket::TransferEnd()
Trace: CFtpControlSocket::ResetOperation(2)
Trace: CControlSocket::ResetOperation(2)
Trace: CFtpControlSocket::ParseSubcommandResult(2)
Trace: CFtpControlSocket::ListSubcommandResult()
Trace: state = 3
Trace: CFtpControlSocket::ResetOperation(2)
Trace: CControlSocket::ResetOperation(2)
Error: Failed to retrieve directory listing
Trace: CFileZillaEnginePrivate::ResetOperation(2)

ftp-ssl 也会报错,虽然有些不同

--> LIST
150 Opening ASCII mode data connection for file list
===>START SSL connect on DATA
ftp: SSL_connect DATA error 0 - error:00000000:lib(0):func(0):reason(0)
226 Closing data connection, sent 70 bytes
421 Service not available, remote server has closed connection

根据我在网上发现的信息,我怀疑这种行为是因为在连接结束时没有发出 close_notify?如果是这样,是否有任何已知的基于 Ruby 的解决方案(例如使用 OpenSSL::SSL::SSLSocket)?

最佳答案

答案很简短:不,如果运行了 tls_start,EventMachine 不会在 close_connection 上发出 close_notify。

关于ruby - 如果运行了 tls_start,EventMachine 会在 close_connection 上发出 close_notify 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12578935/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com