aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-11-26 19:18:35 +0900
committerKazuki Yamaguchi <k@rhe.jp>2017-11-26 19:18:35 +0900
commit01445af367ec9fd12a96c56e31f3b6aa68678a28 (patch)
tree64ac05d85ad76f1b7e94f2dcf61357e49c2cb1c9
parent7c4028a6ceb864df6392881b2e4a21b3200b0b77 (diff)
downloadruby-openssl-01445af367ec9fd12a96c56e31f3b6aa68678a28.tar.gz
test/test_ssl: prevent changing default internal encoding
In Ruby tree (not in this tree), assert_raise_with_message uses EnvUtil.with_default_internal which cannot be called simultaneously. The patch was suggested by Yusuke Endoh (mame).
-rw-r--r--test/test_ssl.rb15
1 files changed, 6 insertions, 9 deletions
diff --git a/test/test_ssl.rb b/test/test_ssl.rb
index 07b87259..cfce1964 100644
--- a/test/test_ssl.rb
+++ b/test/test_ssl.rb
@@ -1223,7 +1223,8 @@ end
end
def test_fallback_scsv
- pend "Fallback SCSV is not supported" unless OpenSSL::SSL::SSLContext.method_defined?( :enable_fallback_scsv)
+ pend "Fallback SCSV is not supported" unless \
+ OpenSSL::SSL::SSLContext.method_defined?(:enable_fallback_scsv)
start_server do |port|
ctx = OpenSSL::SSL::SSLContext.new
@@ -1258,17 +1259,13 @@ end
ctx2.enable_fallback_scsv
ctx2.max_version = OpenSSL::SSL::TLS1_1_VERSION
s2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx2)
- t = Thread.new {
- assert_raise_with_message(OpenSSL::SSL::SSLError, /inappropriate fallback/) {
- s2.connect
- }
- }
-
+ t = Thread.new { s2.connect }
assert_raise_with_message(OpenSSL::SSL::SSLError, /inappropriate fallback/) {
s1.accept
}
-
- assert t.join
+ assert_raise_with_message(OpenSSL::SSL::SSLError, /inappropriate fallback/) {
+ t.join
+ }
ensure
sock1.close
sock2.close