summaryrefslogtreecommitdiff
path: root/test/openssl/utils.rb
diff options
context:
space:
mode:
authorrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-08 01:09:19 +0000
committerrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-08 01:09:19 +0000
commita128c0d33f1d7a66c2c8c5d57fde40acd97becae (patch)
tree6b5d9600c76e8432c1d22e9ef9223910e8162d0f /test/openssl/utils.rb
parentba6ae341bab83dfc7a624c5bf20d8d162dacaff9 (diff)
openssl: import v2.0.0.beta.2
* {ext,test}/openssl: Import Ruby/OpenSSL 2.0.0.beta.2. The full commit history since v2.0.0.beta.1 can be found at: https://github.com/ruby/openssl/compare/v2.0.0.beta.1...v2.0.0.beta.2 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/openssl/utils.rb')
-rw-r--r--test/openssl/utils.rb24
1 files changed, 3 insertions, 21 deletions
diff --git a/test/openssl/utils.rb b/test/openssl/utils.rb
index 2288a260356..6f3a3c6d1c4 100644
--- a/test/openssl/utils.rb
+++ b/test/openssl/utils.rb
@@ -241,10 +241,6 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
def readwrite_loop(ctx, ssl)
while line = ssl.gets
- if line =~ /^STARTTLS$/
- ssl.accept
- next
- end
ssl.write(line)
end
rescue OpenSSL::SSL::SSLError
@@ -281,22 +277,15 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
end
end
- def start_server(verify_mode, start_immediately, args = {}, &block)
+ def start_server(verify_mode: OpenSSL::SSL::VERIFY_NONE, start_immediately: true,
+ ctx_proc: nil, server_proc: method(:readwrite_loop),
+ ignore_listener_error: false, &block)
IO.pipe {|stop_pipe_r, stop_pipe_w|
- ctx_proc = args[:ctx_proc]
- server_proc = args[:server_proc]
- ignore_listener_error = args.fetch(:ignore_listener_error, false)
- use_anon_cipher = args.fetch(:use_anon_cipher, false)
- server_proc ||= method(:readwrite_loop)
-
store = OpenSSL::X509::Store.new
store.add_cert(@ca_cert)
store.purpose = OpenSSL::X509::PURPOSE_SSL_CLIENT
ctx = OpenSSL::SSL::SSLContext.new
- ctx.ciphers = "ADH-AES256-GCM-SHA384" if use_anon_cipher
- ctx.security_level = 0 if use_anon_cipher
ctx.cert_store = store
- #ctx.extra_chain_cert = [ ca_cert ]
ctx.cert = @svr_cert
ctx.key = @svr_key
ctx.tmp_dh_callback = proc { OpenSSL::TestUtils::TEST_KEY_DH1024 }
@@ -341,13 +330,6 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
end
}
end
-
- def starttls(ssl)
- ssl.puts("STARTTLS")
- sleep 1 # When this line is eliminated, process on Cygwin blocks
- # forever at ssl.connect. But I don't know why it does.
- ssl.connect
- end
end
class OpenSSL::PKeyTestCase < OpenSSL::TestCase