summaryrefslogtreecommitdiff
path: root/test/net/ftp
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-29 02:47:11 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-29 02:47:11 +0000
commit7242e6a9b6f692b1d7d3f26bfe4a34356ca743a6 (patch)
treef64c157eddf4a0e372fa5e635744beebffa71ed5 /test/net/ftp
parenta4072112b267766843530768c9eaaf5ee4f3fe8d (diff)
net/ftp: add a new option ssl_handshake_timeout to Net::FTP.new.
The TLS handshake timeout can be specified independently, because the TLS handshake doesn't start just after the underlying connection is established, but after the AUTH command is completed. It's also useful for testing purposes. However, if ssl_handshake_timeout is not specified, open_timeout is used instead for convenience. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net/ftp')
-rw-r--r--test/net/ftp/test_ftp.rb15
1 files changed, 6 insertions, 9 deletions
diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb
index d40e2d8283..fb9852e63d 100644
--- a/test/net/ftp/test_ftp.rb
+++ b/test/net/ftp/test_ftp.rb
@@ -2107,22 +2107,19 @@ EOF
commands = []
sock = nil
@thread = Thread.start do
- begin
- sock = server.accept
- sock.print("220 (test_ftp).\r\n")
- commands.push(sock.gets)
- sock.print("234 AUTH success.\r\n")
- rescue SystemCallError, IOError
- # may be raised by broken connection
- end
+ sock = server.accept
+ sock.print("220 (test_ftp).\r\n")
+ commands.push(sock.gets)
+ sock.print("234 AUTH success.\r\n")
end
begin
assert_raise(Net::OpenTimeout) do
Net::FTP.new("localhost",
port: port,
ssl: { ca_file: CA_FILE },
- open_timeout: 0.1)
+ ssl_handshake_timeout: 0.1)
end
+ @thread.join
ensure
sock.close if sock
server.close