summaryrefslogtreecommitdiff
path: root/test/openssl/ssl_server.rb
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-17 08:04:19 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-17 08:04:19 +0000
commit3691ea5cf42b333a8607df1d2f6d9e22d747d5a1 (patch)
treedb2155a4df5af607c65554f1928ad1a825e7713f /test/openssl/ssl_server.rb
parent9c1e33fc452bfc545eac51a8579d4f3a7f7872b8 (diff)
* test/openssl/ssl_server.rb: try to listen ports from 20443 to 20542
while failed in getting a TCPServer. * test/openssl/test_x509name.rb: remove version dependence about nickname of OIDs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/openssl/ssl_server.rb')
-rw-r--r--test/openssl/ssl_server.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/openssl/ssl_server.rb b/test/openssl/ssl_server.rb
index 699a181256b..5e1303379f7 100644
--- a/test/openssl/ssl_server.rb
+++ b/test/openssl/ssl_server.rb
@@ -46,12 +46,22 @@ ctx.key = ssl_key
ctx.verify_mode = verify_mode
Socket.do_not_reverse_lookup = true
-tcps = TCPServer.new("0.0.0.0", port)
+tcps = nil
+100.times{|i|
+ begin
+ tcps = TCPServer.new("0.0.0.0", port+i)
+ port = port + i
+ break
+ rescue Errno::EADDRINUSE
+ next
+ end
+}
ssls = OpenSSL::SSL::SSLServer.new(tcps, ctx)
ssls.start_immediately = start_immediately
$stdout.sync = true
$stdout.puts Process.pid
+$stdout.puts port
loop do
ssl = ssls.accept