1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

openssl: sync with 2475d94517b4

Merge a commit from upstream:

	01445af367ec test/test_ssl: prevent changing default internal encoding

OpenSSL::TestSSL#test_fallback_scsv could change the default internal
encoding accidentally, causing other unrelated test cases to fail.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
rhe 2017-11-26 10:33:32 +00:00
parent 4f5357689b
commit a996893397

View file

@ -1304,7 +1304,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
@ -1339,17 +1340,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