Skip to content

Commit 01445af

Browse files
committed
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).
1 parent 7c4028a commit 01445af

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

test/test_ssl.rb

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,8 @@ def test_get_ephemeral_key
12231223
end
12241224

12251225
def test_fallback_scsv
1226-
pend "Fallback SCSV is not supported" unless OpenSSL::SSL::SSLContext.method_defined?( :enable_fallback_scsv)
1226+
pend "Fallback SCSV is not supported" unless \
1227+
OpenSSL::SSL::SSLContext.method_defined?(:enable_fallback_scsv)
12271228

12281229
start_server do |port|
12291230
ctx = OpenSSL::SSL::SSLContext.new
@@ -1258,17 +1259,13 @@ def test_fallback_scsv
12581259
ctx2.enable_fallback_scsv
12591260
ctx2.max_version = OpenSSL::SSL::TLS1_1_VERSION
12601261
s2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx2)
1261-
t = Thread.new {
1262-
assert_raise_with_message(OpenSSL::SSL::SSLError, /inappropriate fallback/) {
1263-
s2.connect
1264-
}
1265-
}
1266-
1262+
t = Thread.new { s2.connect }
12671263
assert_raise_with_message(OpenSSL::SSL::SSLError, /inappropriate fallback/) {
12681264
s1.accept
12691265
}
1270-
1271-
assert t.join
1266+
assert_raise_with_message(OpenSSL::SSL::SSLError, /inappropriate fallback/) {
1267+
t.join
1268+
}
12721269
ensure
12731270
sock1.close
12741271
sock2.close

0 commit comments

Comments
 (0)